Before We Start
- Create an account at github.com
- Open up a terminal
1. What is Version Control?
What Does It Do?
- Tracks changes to files
- Any file can be tracked
- Text (.txt, .csv, .py, .c, .R, etc.) works best
- These allow smart diff / merge etc.
Why Use Version Control?
- A more efficient backup
- Reproducibility
Version Control Tracks Changes
Version Control Tracks Changes
Version Control Tracks Changes
Version Control Alternatives
- Git
- Subversion (svn)
- Mercurial (hg)
- Git most widely used in academia
Graphical Version Control
Sourcetree
|
Git Kraken
|
Git Desktop
|
|
|
|
Downloading a Repository
git clone git@github.com:yourname/climate-analysis
Adding & Committing
Differences
More Differences
Restoring Files
Collaboration
Feature-branch
Creating branches
git branch dev
git checkout dev
Branch files
- Create
rainfall_conversion.py
git add rainfall_conversion.py
git commit -m
Pushing & merging
git push origin dev
git switch main
git merge dev