SlideShare a Scribd company logo
CODE VERSION CONTROL
GIUSEPPE MASETTI
ESCI 872 – APPLIED TOOLS FOR OCEAN MAPPING – FUNDAMENTALS OF RESEARCH SOFTWARE DEVELOPMENT
Durham, NH – November 19 & 21, 2019
V1
WHAT IS CODE VERSION CONTROL?
A mechanism to manage changes to code over time.
• Tracking of per-file creation/modifications/deletion
• Ability to switch to past versions to fix bugs
• Facilitating concurrent work on the same project
Help to protect code from both catastrophes
and casual introduction of human error!
VERSION CONTROL SYSTEM (VCS)
Also known as:
Source Code Management (SCM)
Revision Control System (RCS)
CVS, Subversion, Mercurial, Bazaar, Git, etc.
Essential part of the every-day workflow
of a modern research software development team!
Copyright 2014 - 2019 Black Duck Software, Inc., CC-BY, https://www.openhub.net/repositories/compare
GIT .
• Command-line tool that tracks changes in
files and eases collaboration
• Created in 2005 by Linus Torvalds
• Free and open-source → GNU GPL v2
• Goals:
• Handling large project with speed/efficiency
• Data integrity
• Support for non-linear, distributed development
GFDL. Permission of Martin Streicher, Editor-in-
Chief, LINUXMAG.com. CC BY-SA 3.0
SVN VS. GIT
Git
Repo
Git
Repo
Git
Repo
SVN Central
Repo
Working
Copy
Working
Copy
Working
Copy
Centralized VCS Distributed VCS
IN LINUS’ OWN WORDS
2019 RhodeCode, https://rhodecode.com/insights/version-control-systems-2016
GIT → HOW TO INSTALL
Website → https://git-scm.com/
OPEN A WINDOWS SHELL,
THEN RETRIEVE THE GIT’S VERSION.
GIT → HOW TO SETUP
GIT SETUP
• Configure Git with your name and email
• git config --global user.email "your@email.com"
• git config --global user.name "your name"
• Check the current configuration
• git config --list
• The config commands only need to be done once
IN A WINDOWS SHELL
CONFIGURE GIT
WITH YOUR NAME AND EMAIL.
GIT → HOW TO USE
USING GIT
• Creating a new project
• git init → convert a directory into a Git repository (a .git directory is created)
• git add . → a snapshot of the directory content in a temporary staging area
• git commit –m "First commit" → permanently store the snapshot
• The init commands only need to be done once per project.
IN A WINDOWS SHELL
CREATE A GIT PROJECT, THEN
CREATE AND COMMIT A README FILE.
USING GIT
• Making code changes
• git add file0.py file1.py → stage new/updated files
• git diff → to list un-staged changes
• git diff --cached → to see what is ready to be committed
• git status → a brief summary of the repository situation
• git commit –m "A meaningful message" → finally commit your changes
USING GIT
• Making code changes
• git diff → to list un-staged changes
• git add file0.py file1.py → stage new/updated files
• git diff --cached → to see what is ready to be committed
• git status → a brief summary of the repository situation
• git commit –m "A meaningful message" → finally commit your changes
• When to commit code?
• Do it frequently
• Whenever you have reached a milestone/step in your task
FIRST CREATE AND COMMIT TWO SCRIPT FILES,
THEN EDIT ONE OF THEM AND
COMMIT THE CHANGES.
LOCAL CLOUD
Working
Directory
Staging
Area
Local
Repository
Remote
Repository
git add
git commit
git push
git fetch
git checkout
git merge
GIT HOSTING SERVICES
• Several sites offer services for hosting Git repositories
• Popular ones that are free for open-source projects:
GITHUB
• A social network for code share/collaboration
• It was acquired by Microsoft in 2018 for $7.5 billion.
GITHUB
• A social network for code share/collaboration
• It was acquired by Microsoft in 2018 for $7.5 billion.
• To push to the GitHub repository:
• Setup a remote (just once):
• git remote add origin https://github.com/giumas/myproject.git
• Push committed code (multiple times):
• git push origin master
• Reload project webpage
PUSH THE PREVIOUSLY CREATED PROJECT CODE
TO A GIT HOSTING SERVICE.
EPOM SERVER → JUPYTER TERMINAL
EPOM SERVER → CLONING GIT REPO
git clone https://github.com/giumas/myproject.git
EPOM SERVER → GIT REPO HISTORY
git log
EPOM SERVER → RUN A SCRIPT
ON THE EPOM SERVER
CLONE YOUR GIT REPOSITORY,
THEN EXECUTE ONE OF THE SCRIPTS.
LOCAL MACHINE GITHUB
Git
Repository
Git
Repository
git push
EPOM SERVER
git clone
Git
Repository
git push
git pull
git push
git pull
git push
COMMIT CHANGES ON YOUR LOCAL MACHINE,
THEN RETRIEVE THEM ON THE EPOM SERVER.
https://jrebel.com/rebellabs/git-commands-and-best-practices-cheat-sheet/
GIT GUI CLIENT → TORTOISEGIT
A windows shell extension to work with Git repositories.
• Shell integration
• Icon overlays
• Easy access to Git commands
TORTOISEGIT → ICON OVERLAYS
• Normal → all changes committed
• Modified → changes are present
• Staged → changes are ready to be committed
• Deleted → file/folder scheduled to be deleted
• Added → file/folder scheduled to be added
• Ignored → file/folder ignored by Git
• Conflict → there is a conflict between code versions
https://tortoisegit.org/docs/tortoisegit/tgit-dug-wcstatus.html#tgit-dug-wcstatus-1
TORTOISEGIT → SWITCH TO PAST COMMITS
TORTOISEGIT → SWITCH TO PAST COMMITS
TORTOISEGIT → SWITCH TO PAST COMMITS
TORTOISEGIT → SWITCH TO PAST COMMITS
USING TORTOISEGIT
SWITCH TO A PAST COMMIT,
THEN EXECUTE THE RESULTING SCRIPT.
QUESTIONS?
Contact me at: gmasetti@ccom.unh.edu

More Related Content

What's hot

Gitops: the kubernetes way
Gitops: the kubernetes wayGitops: the kubernetes way
Gitops: the kubernetes way
sparkfabrik
 
Gitops: a new paradigm for software defined operations
Gitops: a new paradigm for software defined operationsGitops: a new paradigm for software defined operations
Gitops: a new paradigm for software defined operations
Mariano Cunietti
 
GitOps: Git come unica fonte di verità per applicazioni e infrastruttura
GitOps: Git come unica fonte di verità per applicazioni e infrastrutturaGitOps: Git come unica fonte di verità per applicazioni e infrastruttura
GitOps: Git come unica fonte di verità per applicazioni e infrastruttura
sparkfabrik
 
GitOps for Helm Users by Scott Rigby
GitOps for Helm Users by Scott RigbyGitOps for Helm Users by Scott Rigby
GitOps for Helm Users by Scott Rigby
Weaveworks
 
GitOps - Operation By Pull Request
GitOps - Operation By Pull RequestGitOps - Operation By Pull Request
GitOps - Operation By Pull Request
Kasper Nissen
 
Gitops Hands On
Gitops Hands OnGitops Hands On
Gitops Hands On
Brice Fernandes
 
CI:CD in Lightspeed with kubernetes and argo cd
CI:CD in Lightspeed with kubernetes and argo cdCI:CD in Lightspeed with kubernetes and argo cd
CI:CD in Lightspeed with kubernetes and argo cd
Billy Yuen
 
GitOps Toolkit (Cloud Native Nordics Tech Talk)
GitOps Toolkit (Cloud Native Nordics Tech Talk)GitOps Toolkit (Cloud Native Nordics Tech Talk)
GitOps Toolkit (Cloud Native Nordics Tech Talk)
Weaveworks
 
The Power of GitOps with Flux & GitOps Toolkit
The Power of GitOps with Flux & GitOps ToolkitThe Power of GitOps with Flux & GitOps Toolkit
The Power of GitOps with Flux & GitOps Toolkit
Weaveworks
 
Docker New York City: From GitOps to a scalable CI/CD Pattern for Kubernetes
Docker New York City: From GitOps to a scalable CI/CD Pattern for KubernetesDocker New York City: From GitOps to a scalable CI/CD Pattern for Kubernetes
Docker New York City: From GitOps to a scalable CI/CD Pattern for Kubernetes
Andrew Phillips
 
Git overview
Git overviewGit overview
Git overview
Gowarthini
 
GitOps - Modern best practices for high velocity app dev using cloud native t...
GitOps - Modern best practices for high velocity app dev using cloud native t...GitOps - Modern best practices for high velocity app dev using cloud native t...
GitOps - Modern best practices for high velocity app dev using cloud native t...
Weaveworks
 
Enabling GitOps - Architecture for Implementation
Enabling GitOps - Architecture for ImplementationEnabling GitOps - Architecture for Implementation
Enabling GitOps - Architecture for Implementation
Huynh Thai Bao
 
Git & git hub
Git & git hubGit & git hub
Git & git hub
PreetikaKanojia
 
OpenStack and DevOps - DevOps Meetup
OpenStack and DevOps - DevOps MeetupOpenStack and DevOps - DevOps Meetup
OpenStack and DevOps - DevOps Meetup
Opsta
 
Introducing Git and git flow
Introducing Git and git flow Introducing Git and git flow
Introducing Git and git flow
Sebin Benjamin
 
GitOps and Kubernetes: a radical idea
GitOps and Kubernetes: a radical ideaGitOps and Kubernetes: a radical idea
GitOps and Kubernetes: a radical idea
Manning Publications
 
GitOps with ArgoCD
GitOps with ArgoCDGitOps with ArgoCD
GitOps with ArgoCD
CloudOps2005
 
Git
GitGit

What's hot (20)

Gitops: the kubernetes way
Gitops: the kubernetes wayGitops: the kubernetes way
Gitops: the kubernetes way
 
Gitops: a new paradigm for software defined operations
Gitops: a new paradigm for software defined operationsGitops: a new paradigm for software defined operations
Gitops: a new paradigm for software defined operations
 
GitOps: Git come unica fonte di verità per applicazioni e infrastruttura
GitOps: Git come unica fonte di verità per applicazioni e infrastrutturaGitOps: Git come unica fonte di verità per applicazioni e infrastruttura
GitOps: Git come unica fonte di verità per applicazioni e infrastruttura
 
GitOps for Helm Users by Scott Rigby
GitOps for Helm Users by Scott RigbyGitOps for Helm Users by Scott Rigby
GitOps for Helm Users by Scott Rigby
 
GitOps - Operation By Pull Request
GitOps - Operation By Pull RequestGitOps - Operation By Pull Request
GitOps - Operation By Pull Request
 
Gitops Hands On
Gitops Hands OnGitops Hands On
Gitops Hands On
 
CI:CD in Lightspeed with kubernetes and argo cd
CI:CD in Lightspeed with kubernetes and argo cdCI:CD in Lightspeed with kubernetes and argo cd
CI:CD in Lightspeed with kubernetes and argo cd
 
Git General
Git GeneralGit General
Git General
 
GitOps Toolkit (Cloud Native Nordics Tech Talk)
GitOps Toolkit (Cloud Native Nordics Tech Talk)GitOps Toolkit (Cloud Native Nordics Tech Talk)
GitOps Toolkit (Cloud Native Nordics Tech Talk)
 
The Power of GitOps with Flux & GitOps Toolkit
The Power of GitOps with Flux & GitOps ToolkitThe Power of GitOps with Flux & GitOps Toolkit
The Power of GitOps with Flux & GitOps Toolkit
 
Docker New York City: From GitOps to a scalable CI/CD Pattern for Kubernetes
Docker New York City: From GitOps to a scalable CI/CD Pattern for KubernetesDocker New York City: From GitOps to a scalable CI/CD Pattern for Kubernetes
Docker New York City: From GitOps to a scalable CI/CD Pattern for Kubernetes
 
Git overview
Git overviewGit overview
Git overview
 
GitOps - Modern best practices for high velocity app dev using cloud native t...
GitOps - Modern best practices for high velocity app dev using cloud native t...GitOps - Modern best practices for high velocity app dev using cloud native t...
GitOps - Modern best practices for high velocity app dev using cloud native t...
 
Enabling GitOps - Architecture for Implementation
Enabling GitOps - Architecture for ImplementationEnabling GitOps - Architecture for Implementation
Enabling GitOps - Architecture for Implementation
 
Git & git hub
Git & git hubGit & git hub
Git & git hub
 
OpenStack and DevOps - DevOps Meetup
OpenStack and DevOps - DevOps MeetupOpenStack and DevOps - DevOps Meetup
OpenStack and DevOps - DevOps Meetup
 
Introducing Git and git flow
Introducing Git and git flow Introducing Git and git flow
Introducing Git and git flow
 
GitOps and Kubernetes: a radical idea
GitOps and Kubernetes: a radical ideaGitOps and Kubernetes: a radical idea
GitOps and Kubernetes: a radical idea
 
GitOps with ArgoCD
GitOps with ArgoCDGitOps with ArgoCD
GitOps with ArgoCD
 
Git
GitGit
Git
 

Similar to ePOM - Fundamentals of Research Software Development - Code Version Control

Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
Betclic Everest Group Tech Team
 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hub
Naveen Pandey
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
Kishor Kumar
 
Introduction to git and githhub with practicals.pptx
Introduction to git and githhub with practicals.pptxIntroduction to git and githhub with practicals.pptx
Introduction to git and githhub with practicals.pptx
Abdul Salam
 
Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Untangling fall2017 week2_try2
Untangling fall2017 week2_try2
Derek Jacoby
 
Untangling fall2017 week2
Untangling fall2017 week2Untangling fall2017 week2
Untangling fall2017 week2
Derek Jacoby
 
Davinci git brown_bag
Davinci git brown_bagDavinci git brown_bag
Davinci git brown_bagJason Noble
 
The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubThe Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHub
BigBlueHat
 
Introduction to Git for Network Engineers
Introduction to Git for Network EngineersIntroduction to Git for Network Engineers
Introduction to Git for Network Engineers
Joel W. King
 
Git training (basic)
Git training (basic)Git training (basic)
Git training (basic)
Arashdeepkaur16
 
Git extension-training
Git extension-trainingGit extension-training
Git extension-training
Eric Guo
 
Data science Git management
Data science Git managementData science Git management
Data science Git management
Arindam Banerjee
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitRobert Lee-Cann
 
Learn Git - For Beginners and Intermediate levels
Learn Git - For Beginners and Intermediate levelsLearn Git - For Beginners and Intermediate levels
Learn Git - For Beginners and Intermediate levels
Gorav Singal
 
Git for folk who like GUIs
Git for folk who like GUIsGit for folk who like GUIs
Git for folk who like GUIs
Tim Osborn
 
Git
GitGit
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
Md Atique Ahmed Ziad
 
Using Git to Organize Your Project
Using Git to Organize Your ProjectUsing Git to Organize Your Project
Using Git to Organize Your Project
Manish Suwal 'Enwil'
 
Let's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHubLet's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHub
Kim Moir
 
CSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITCSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GIT
PouriaQashqai1
 

Similar to ePOM - Fundamentals of Research Software Development - Code Version Control (20)

Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hub
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
 
Introduction to git and githhub with practicals.pptx
Introduction to git and githhub with practicals.pptxIntroduction to git and githhub with practicals.pptx
Introduction to git and githhub with practicals.pptx
 
Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Untangling fall2017 week2_try2
Untangling fall2017 week2_try2
 
Untangling fall2017 week2
Untangling fall2017 week2Untangling fall2017 week2
Untangling fall2017 week2
 
Davinci git brown_bag
Davinci git brown_bagDavinci git brown_bag
Davinci git brown_bag
 
The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubThe Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHub
 
Introduction to Git for Network Engineers
Introduction to Git for Network EngineersIntroduction to Git for Network Engineers
Introduction to Git for Network Engineers
 
Git training (basic)
Git training (basic)Git training (basic)
Git training (basic)
 
Git extension-training
Git extension-trainingGit extension-training
Git extension-training
 
Data science Git management
Data science Git managementData science Git management
Data science Git management
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with Git
 
Learn Git - For Beginners and Intermediate levels
Learn Git - For Beginners and Intermediate levelsLearn Git - For Beginners and Intermediate levels
Learn Git - For Beginners and Intermediate levels
 
Git for folk who like GUIs
Git for folk who like GUIsGit for folk who like GUIs
Git for folk who like GUIs
 
Git
GitGit
Git
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Using Git to Organize Your Project
Using Git to Organize Your ProjectUsing Git to Organize Your Project
Using Git to Organize Your Project
 
Let's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHubLet's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHub
 
CSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITCSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GIT
 

More from Giuseppe Masetti

e-learning Python for Ocean Mapping - Empowering the next generation of ocean...
e-learning Python for Ocean Mapping - Empowering the next generation of ocean...e-learning Python for Ocean Mapping - Empowering the next generation of ocean...
e-learning Python for Ocean Mapping - Empowering the next generation of ocean...
Giuseppe Masetti
 
Leveraging Predictions from NOAA’s Oceanographic Forecast Models to Increase ...
Leveraging Predictions from NOAA’s Oceanographic Forecast Models to Increase ...Leveraging Predictions from NOAA’s Oceanographic Forecast Models to Increase ...
Leveraging Predictions from NOAA’s Oceanographic Forecast Models to Increase ...
Giuseppe Masetti
 
ePOM - Fundamentals of Research Software Development - Introduction
ePOM - Fundamentals of Research Software Development - IntroductionePOM - Fundamentals of Research Software Development - Introduction
ePOM - Fundamentals of Research Software Development - Introduction
Giuseppe Masetti
 
ePOM - Intro to Ocean Data Science - Raster and Vector Data Formats
ePOM - Intro to Ocean Data Science - Raster and Vector Data FormatsePOM - Intro to Ocean Data Science - Raster and Vector Data Formats
ePOM - Intro to Ocean Data Science - Raster and Vector Data Formats
Giuseppe Masetti
 
ePOM - Intro to Ocean Data Science - Scientific Computing
ePOM - Intro to Ocean Data Science - Scientific ComputingePOM - Intro to Ocean Data Science - Scientific Computing
ePOM - Intro to Ocean Data Science - Scientific Computing
Giuseppe Masetti
 
ePOM - Intro to Ocean Data Science - Data Visualization
ePOM - Intro to Ocean Data Science - Data VisualizationePOM - Intro to Ocean Data Science - Data Visualization
ePOM - Intro to Ocean Data Science - Data Visualization
Giuseppe Masetti
 
ePOM - Intro to Ocean Data Science - Object-Oriented Programming
ePOM - Intro to Ocean Data Science - Object-Oriented ProgrammingePOM - Intro to Ocean Data Science - Object-Oriented Programming
ePOM - Intro to Ocean Data Science - Object-Oriented Programming
Giuseppe Masetti
 
AusSeabed workshop - Pydro and Hydroffice - Days 2 and 3
AusSeabed workshop - Pydro and Hydroffice - Days 2 and 3AusSeabed workshop - Pydro and Hydroffice - Days 2 and 3
AusSeabed workshop - Pydro and Hydroffice - Days 2 and 3
Giuseppe Masetti
 
AusSeabed workshop - Pydro and Hydroffice - Day 1
AusSeabed workshop - Pydro and Hydroffice - Day 1AusSeabed workshop - Pydro and Hydroffice - Day 1
AusSeabed workshop - Pydro and Hydroffice - Day 1
Giuseppe Masetti
 
Hydrographic Survey Validation and Chart Adequacy Assessment Using Automated ...
Hydrographic Survey Validation and Chart Adequacy Assessment Using Automated ...Hydrographic Survey Validation and Chart Adequacy Assessment Using Automated ...
Hydrographic Survey Validation and Chart Adequacy Assessment Using Automated ...
Giuseppe Masetti
 
The Open Backscatter Toolchain (OpenBST) project: towards an open-source and ...
The Open Backscatter Toolchain (OpenBST) project: towards an open-source and ...The Open Backscatter Toolchain (OpenBST) project: towards an open-source and ...
The Open Backscatter Toolchain (OpenBST) project: towards an open-source and ...
Giuseppe Masetti
 
Pydro & HydrOffice: Open Tools for Ocean Mappers
Pydro & HydrOffice: Open Tools for Ocean MappersPydro & HydrOffice: Open Tools for Ocean Mappers
Pydro & HydrOffice: Open Tools for Ocean Mappers
Giuseppe Masetti
 
INMARTECH 2018 - G.Masetti & P.Johnson - Sound Speed Management and Environme...
INMARTECH 2018 - G.Masetti & P.Johnson - Sound Speed Management and Environme...INMARTECH 2018 - G.Masetti & P.Johnson - Sound Speed Management and Environme...
INMARTECH 2018 - G.Masetti & P.Johnson - Sound Speed Management and Environme...
Giuseppe Masetti
 
Backscatter Working Group Software Inter-comparison Project Requesting and Co...
Backscatter Working Group Software Inter-comparison ProjectRequesting and Co...Backscatter Working Group Software Inter-comparison ProjectRequesting and Co...
Backscatter Working Group Software Inter-comparison Project Requesting and Co...
Giuseppe Masetti
 
Shallow Survey 2018 - Applications of Sonar Detection Uncertainty for Survey ...
Shallow Survey 2018 - Applications of Sonar Detection Uncertainty for Survey ...Shallow Survey 2018 - Applications of Sonar Detection Uncertainty for Survey ...
Shallow Survey 2018 - Applications of Sonar Detection Uncertainty for Survey ...
Giuseppe Masetti
 
Bathymetric Attributed Grid (BAG) format
Bathymetric Attributed Grid (BAG) formatBathymetric Attributed Grid (BAG) format
Bathymetric Attributed Grid (BAG) format
Giuseppe Masetti
 
Masetti et al. - Bathymetric and reflectivity-derived data fusion for Prelimi...
Masetti et al. - Bathymetric and reflectivity-derived data fusion for Prelimi...Masetti et al. - Bathymetric and reflectivity-derived data fusion for Prelimi...
Masetti et al. - Bathymetric and reflectivity-derived data fusion for Prelimi...
Giuseppe Masetti
 
HydrOffice: past, present, and future.
HydrOffice: past, present, and future.HydrOffice: past, present, and future.
HydrOffice: past, present, and future.
Giuseppe Masetti
 

More from Giuseppe Masetti (18)

e-learning Python for Ocean Mapping - Empowering the next generation of ocean...
e-learning Python for Ocean Mapping - Empowering the next generation of ocean...e-learning Python for Ocean Mapping - Empowering the next generation of ocean...
e-learning Python for Ocean Mapping - Empowering the next generation of ocean...
 
Leveraging Predictions from NOAA’s Oceanographic Forecast Models to Increase ...
Leveraging Predictions from NOAA’s Oceanographic Forecast Models to Increase ...Leveraging Predictions from NOAA’s Oceanographic Forecast Models to Increase ...
Leveraging Predictions from NOAA’s Oceanographic Forecast Models to Increase ...
 
ePOM - Fundamentals of Research Software Development - Introduction
ePOM - Fundamentals of Research Software Development - IntroductionePOM - Fundamentals of Research Software Development - Introduction
ePOM - Fundamentals of Research Software Development - Introduction
 
ePOM - Intro to Ocean Data Science - Raster and Vector Data Formats
ePOM - Intro to Ocean Data Science - Raster and Vector Data FormatsePOM - Intro to Ocean Data Science - Raster and Vector Data Formats
ePOM - Intro to Ocean Data Science - Raster and Vector Data Formats
 
ePOM - Intro to Ocean Data Science - Scientific Computing
ePOM - Intro to Ocean Data Science - Scientific ComputingePOM - Intro to Ocean Data Science - Scientific Computing
ePOM - Intro to Ocean Data Science - Scientific Computing
 
ePOM - Intro to Ocean Data Science - Data Visualization
ePOM - Intro to Ocean Data Science - Data VisualizationePOM - Intro to Ocean Data Science - Data Visualization
ePOM - Intro to Ocean Data Science - Data Visualization
 
ePOM - Intro to Ocean Data Science - Object-Oriented Programming
ePOM - Intro to Ocean Data Science - Object-Oriented ProgrammingePOM - Intro to Ocean Data Science - Object-Oriented Programming
ePOM - Intro to Ocean Data Science - Object-Oriented Programming
 
AusSeabed workshop - Pydro and Hydroffice - Days 2 and 3
AusSeabed workshop - Pydro and Hydroffice - Days 2 and 3AusSeabed workshop - Pydro and Hydroffice - Days 2 and 3
AusSeabed workshop - Pydro and Hydroffice - Days 2 and 3
 
AusSeabed workshop - Pydro and Hydroffice - Day 1
AusSeabed workshop - Pydro and Hydroffice - Day 1AusSeabed workshop - Pydro and Hydroffice - Day 1
AusSeabed workshop - Pydro and Hydroffice - Day 1
 
Hydrographic Survey Validation and Chart Adequacy Assessment Using Automated ...
Hydrographic Survey Validation and Chart Adequacy Assessment Using Automated ...Hydrographic Survey Validation and Chart Adequacy Assessment Using Automated ...
Hydrographic Survey Validation and Chart Adequacy Assessment Using Automated ...
 
The Open Backscatter Toolchain (OpenBST) project: towards an open-source and ...
The Open Backscatter Toolchain (OpenBST) project: towards an open-source and ...The Open Backscatter Toolchain (OpenBST) project: towards an open-source and ...
The Open Backscatter Toolchain (OpenBST) project: towards an open-source and ...
 
Pydro & HydrOffice: Open Tools for Ocean Mappers
Pydro & HydrOffice: Open Tools for Ocean MappersPydro & HydrOffice: Open Tools for Ocean Mappers
Pydro & HydrOffice: Open Tools for Ocean Mappers
 
INMARTECH 2018 - G.Masetti & P.Johnson - Sound Speed Management and Environme...
INMARTECH 2018 - G.Masetti & P.Johnson - Sound Speed Management and Environme...INMARTECH 2018 - G.Masetti & P.Johnson - Sound Speed Management and Environme...
INMARTECH 2018 - G.Masetti & P.Johnson - Sound Speed Management and Environme...
 
Backscatter Working Group Software Inter-comparison Project Requesting and Co...
Backscatter Working Group Software Inter-comparison ProjectRequesting and Co...Backscatter Working Group Software Inter-comparison ProjectRequesting and Co...
Backscatter Working Group Software Inter-comparison Project Requesting and Co...
 
Shallow Survey 2018 - Applications of Sonar Detection Uncertainty for Survey ...
Shallow Survey 2018 - Applications of Sonar Detection Uncertainty for Survey ...Shallow Survey 2018 - Applications of Sonar Detection Uncertainty for Survey ...
Shallow Survey 2018 - Applications of Sonar Detection Uncertainty for Survey ...
 
Bathymetric Attributed Grid (BAG) format
Bathymetric Attributed Grid (BAG) formatBathymetric Attributed Grid (BAG) format
Bathymetric Attributed Grid (BAG) format
 
Masetti et al. - Bathymetric and reflectivity-derived data fusion for Prelimi...
Masetti et al. - Bathymetric and reflectivity-derived data fusion for Prelimi...Masetti et al. - Bathymetric and reflectivity-derived data fusion for Prelimi...
Masetti et al. - Bathymetric and reflectivity-derived data fusion for Prelimi...
 
HydrOffice: past, present, and future.
HydrOffice: past, present, and future.HydrOffice: past, present, and future.
HydrOffice: past, present, and future.
 

Recently uploaded

Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...
Sérgio Sacani
 
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
Scintica Instrumentation
 
What is greenhouse gasses and how many gasses are there to affect the Earth.
What is greenhouse gasses and how many gasses are there to affect the Earth.What is greenhouse gasses and how many gasses are there to affect the Earth.
What is greenhouse gasses and how many gasses are there to affect the Earth.
moosaasad1975
 
ESR_factors_affect-clinic significance-Pathysiology.pptx
ESR_factors_affect-clinic significance-Pathysiology.pptxESR_factors_affect-clinic significance-Pathysiology.pptx
ESR_factors_affect-clinic significance-Pathysiology.pptx
muralinath2
 
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Sérgio Sacani
 
EY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptxEY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptx
AlguinaldoKong
 
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATIONPRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
ChetanK57
 
In silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptxIn silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptx
AlaminAfendy1
 
GBSN - Microbiology (Lab 4) Culture Media
GBSN - Microbiology (Lab 4) Culture MediaGBSN - Microbiology (Lab 4) Culture Media
GBSN - Microbiology (Lab 4) Culture Media
Areesha Ahmad
 
NuGOweek 2024 Ghent - programme - final version
NuGOweek 2024 Ghent - programme - final versionNuGOweek 2024 Ghent - programme - final version
NuGOweek 2024 Ghent - programme - final version
pablovgd
 
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
NathanBaughman3
 
GBSN - Biochemistry (Unit 5) Chemistry of Lipids
GBSN - Biochemistry (Unit 5) Chemistry of LipidsGBSN - Biochemistry (Unit 5) Chemistry of Lipids
GBSN - Biochemistry (Unit 5) Chemistry of Lipids
Areesha Ahmad
 
Cancer cell metabolism: special Reference to Lactate Pathway
Cancer cell metabolism: special Reference to Lactate PathwayCancer cell metabolism: special Reference to Lactate Pathway
Cancer cell metabolism: special Reference to Lactate Pathway
AADYARAJPANDEY1
 
Richard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlandsRichard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlands
Richard Gill
 
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Sérgio Sacani
 
Structural Classification Of Protein (SCOP)
Structural Classification Of Protein  (SCOP)Structural Classification Of Protein  (SCOP)
Structural Classification Of Protein (SCOP)
aishnasrivastava
 
platelets- lifespan -Clot retraction-disorders.pptx
platelets- lifespan -Clot retraction-disorders.pptxplatelets- lifespan -Clot retraction-disorders.pptx
platelets- lifespan -Clot retraction-disorders.pptx
muralinath2
 
Unveiling the Energy Potential of Marshmallow Deposits.pdf
Unveiling the Energy Potential of Marshmallow Deposits.pdfUnveiling the Energy Potential of Marshmallow Deposits.pdf
Unveiling the Energy Potential of Marshmallow Deposits.pdf
Erdal Coalmaker
 
Richard's entangled aventures in wonderland
Richard's entangled aventures in wonderlandRichard's entangled aventures in wonderland
Richard's entangled aventures in wonderland
Richard Gill
 
in vitro propagation of plants lecture note.pptx
in vitro propagation of plants lecture note.pptxin vitro propagation of plants lecture note.pptx
in vitro propagation of plants lecture note.pptx
yusufzako14
 

Recently uploaded (20)

Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...
 
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
 
What is greenhouse gasses and how many gasses are there to affect the Earth.
What is greenhouse gasses and how many gasses are there to affect the Earth.What is greenhouse gasses and how many gasses are there to affect the Earth.
What is greenhouse gasses and how many gasses are there to affect the Earth.
 
ESR_factors_affect-clinic significance-Pathysiology.pptx
ESR_factors_affect-clinic significance-Pathysiology.pptxESR_factors_affect-clinic significance-Pathysiology.pptx
ESR_factors_affect-clinic significance-Pathysiology.pptx
 
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
 
EY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptxEY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptx
 
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATIONPRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
 
In silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptxIn silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptx
 
GBSN - Microbiology (Lab 4) Culture Media
GBSN - Microbiology (Lab 4) Culture MediaGBSN - Microbiology (Lab 4) Culture Media
GBSN - Microbiology (Lab 4) Culture Media
 
NuGOweek 2024 Ghent - programme - final version
NuGOweek 2024 Ghent - programme - final versionNuGOweek 2024 Ghent - programme - final version
NuGOweek 2024 Ghent - programme - final version
 
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
 
GBSN - Biochemistry (Unit 5) Chemistry of Lipids
GBSN - Biochemistry (Unit 5) Chemistry of LipidsGBSN - Biochemistry (Unit 5) Chemistry of Lipids
GBSN - Biochemistry (Unit 5) Chemistry of Lipids
 
Cancer cell metabolism: special Reference to Lactate Pathway
Cancer cell metabolism: special Reference to Lactate PathwayCancer cell metabolism: special Reference to Lactate Pathway
Cancer cell metabolism: special Reference to Lactate Pathway
 
Richard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlandsRichard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlands
 
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
 
Structural Classification Of Protein (SCOP)
Structural Classification Of Protein  (SCOP)Structural Classification Of Protein  (SCOP)
Structural Classification Of Protein (SCOP)
 
platelets- lifespan -Clot retraction-disorders.pptx
platelets- lifespan -Clot retraction-disorders.pptxplatelets- lifespan -Clot retraction-disorders.pptx
platelets- lifespan -Clot retraction-disorders.pptx
 
Unveiling the Energy Potential of Marshmallow Deposits.pdf
Unveiling the Energy Potential of Marshmallow Deposits.pdfUnveiling the Energy Potential of Marshmallow Deposits.pdf
Unveiling the Energy Potential of Marshmallow Deposits.pdf
 
Richard's entangled aventures in wonderland
Richard's entangled aventures in wonderlandRichard's entangled aventures in wonderland
Richard's entangled aventures in wonderland
 
in vitro propagation of plants lecture note.pptx
in vitro propagation of plants lecture note.pptxin vitro propagation of plants lecture note.pptx
in vitro propagation of plants lecture note.pptx
 

ePOM - Fundamentals of Research Software Development - Code Version Control

  • 1. CODE VERSION CONTROL GIUSEPPE MASETTI ESCI 872 – APPLIED TOOLS FOR OCEAN MAPPING – FUNDAMENTALS OF RESEARCH SOFTWARE DEVELOPMENT Durham, NH – November 19 & 21, 2019 V1
  • 2. WHAT IS CODE VERSION CONTROL? A mechanism to manage changes to code over time. • Tracking of per-file creation/modifications/deletion • Ability to switch to past versions to fix bugs • Facilitating concurrent work on the same project Help to protect code from both catastrophes and casual introduction of human error!
  • 3. VERSION CONTROL SYSTEM (VCS) Also known as: Source Code Management (SCM) Revision Control System (RCS) CVS, Subversion, Mercurial, Bazaar, Git, etc. Essential part of the every-day workflow of a modern research software development team!
  • 4. Copyright 2014 - 2019 Black Duck Software, Inc., CC-BY, https://www.openhub.net/repositories/compare
  • 5. GIT . • Command-line tool that tracks changes in files and eases collaboration • Created in 2005 by Linus Torvalds • Free and open-source → GNU GPL v2 • Goals: • Handling large project with speed/efficiency • Data integrity • Support for non-linear, distributed development GFDL. Permission of Martin Streicher, Editor-in- Chief, LINUXMAG.com. CC BY-SA 3.0
  • 6. SVN VS. GIT Git Repo Git Repo Git Repo SVN Central Repo Working Copy Working Copy Working Copy Centralized VCS Distributed VCS
  • 9. GIT → HOW TO INSTALL
  • 11.
  • 12.
  • 13. OPEN A WINDOWS SHELL, THEN RETRIEVE THE GIT’S VERSION.
  • 14. GIT → HOW TO SETUP
  • 15. GIT SETUP • Configure Git with your name and email • git config --global user.email "your@email.com" • git config --global user.name "your name" • Check the current configuration • git config --list • The config commands only need to be done once
  • 16. IN A WINDOWS SHELL CONFIGURE GIT WITH YOUR NAME AND EMAIL.
  • 17. GIT → HOW TO USE
  • 18. USING GIT • Creating a new project • git init → convert a directory into a Git repository (a .git directory is created) • git add . → a snapshot of the directory content in a temporary staging area • git commit –m "First commit" → permanently store the snapshot • The init commands only need to be done once per project.
  • 19.
  • 20. IN A WINDOWS SHELL CREATE A GIT PROJECT, THEN CREATE AND COMMIT A README FILE.
  • 21. USING GIT • Making code changes • git add file0.py file1.py → stage new/updated files • git diff → to list un-staged changes • git diff --cached → to see what is ready to be committed • git status → a brief summary of the repository situation • git commit –m "A meaningful message" → finally commit your changes
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27. USING GIT • Making code changes • git diff → to list un-staged changes • git add file0.py file1.py → stage new/updated files • git diff --cached → to see what is ready to be committed • git status → a brief summary of the repository situation • git commit –m "A meaningful message" → finally commit your changes • When to commit code? • Do it frequently • Whenever you have reached a milestone/step in your task
  • 28. FIRST CREATE AND COMMIT TWO SCRIPT FILES, THEN EDIT ONE OF THEM AND COMMIT THE CHANGES.
  • 30. GIT HOSTING SERVICES • Several sites offer services for hosting Git repositories • Popular ones that are free for open-source projects:
  • 31. GITHUB • A social network for code share/collaboration • It was acquired by Microsoft in 2018 for $7.5 billion.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36. GITHUB • A social network for code share/collaboration • It was acquired by Microsoft in 2018 for $7.5 billion. • To push to the GitHub repository: • Setup a remote (just once): • git remote add origin https://github.com/giumas/myproject.git • Push committed code (multiple times): • git push origin master • Reload project webpage
  • 37.
  • 38.
  • 39. PUSH THE PREVIOUSLY CREATED PROJECT CODE TO A GIT HOSTING SERVICE.
  • 40. EPOM SERVER → JUPYTER TERMINAL
  • 41. EPOM SERVER → CLONING GIT REPO git clone https://github.com/giumas/myproject.git
  • 42. EPOM SERVER → GIT REPO HISTORY git log
  • 43. EPOM SERVER → RUN A SCRIPT
  • 44. ON THE EPOM SERVER CLONE YOUR GIT REPOSITORY, THEN EXECUTE ONE OF THE SCRIPTS.
  • 45. LOCAL MACHINE GITHUB Git Repository Git Repository git push EPOM SERVER git clone Git Repository git push git pull git push git pull git push
  • 46.
  • 47.
  • 48.
  • 49. COMMIT CHANGES ON YOUR LOCAL MACHINE, THEN RETRIEVE THEM ON THE EPOM SERVER.
  • 51. GIT GUI CLIENT → TORTOISEGIT A windows shell extension to work with Git repositories.
  • 52.
  • 53. • Shell integration • Icon overlays • Easy access to Git commands
  • 54. TORTOISEGIT → ICON OVERLAYS • Normal → all changes committed • Modified → changes are present • Staged → changes are ready to be committed • Deleted → file/folder scheduled to be deleted • Added → file/folder scheduled to be added • Ignored → file/folder ignored by Git • Conflict → there is a conflict between code versions https://tortoisegit.org/docs/tortoisegit/tgit-dug-wcstatus.html#tgit-dug-wcstatus-1
  • 55. TORTOISEGIT → SWITCH TO PAST COMMITS
  • 56. TORTOISEGIT → SWITCH TO PAST COMMITS
  • 57. TORTOISEGIT → SWITCH TO PAST COMMITS
  • 58. TORTOISEGIT → SWITCH TO PAST COMMITS
  • 59. USING TORTOISEGIT SWITCH TO A PAST COMMIT, THEN EXECUTE THE RESULTING SCRIPT.
  • 60. QUESTIONS? Contact me at: gmasetti@ccom.unh.edu