-
Notifications
You must be signed in to change notification settings - Fork 18
Git workflow for tutorials
Basic workflow to follow along with tutorials and save changes to your fork, while staying up to date with any changes made to the master tutorial.
Fork the tutorial repository via the GitHub web user interface.
For example, https://github.com/friedrichknuth/geospatial-analysis forked from https://github.com/ICESAT-2HackWeek/geospatial-analysis .
Clone the forked tutorial to your machine.
$ git clone https://github.com/friedrichknuth/geospatial-analysis.git
$ cd geospatial-analysis
Add the upstream master so we can stay up to date with any changes made to the main tutorial.
$ git remote add upstream https://github.com/ICESAT-2HackWeek/geospatial-analysis.git
Fetch and merge the latest changes from upstream master.
$ git fetch upstream
$ git merge upstream/master
Checkout a branch to make changes and follow along with the tutorial.
$ git checkout -b branch_name
Follow along and make changes. Then commit your changes and push them up to your fork, under your branch.
$ git commit -am "Make changes"
$ git push origin branch_name
Now your fork will have your changes backed up to GitHub under your branch.
If additional changes were made to the upstream master tutorial, you can checkout the master branch $ git checkout master
and repeat step 4 to get the latest content, then checkout a new branch with a different name and follow along from there.