Go to TogaWare.com Home Page. GNU/Linux Desktop Survival Guide
by Graham Williams
Duck Duck Go

Creating a Fork


20181228On github click Fork on the original repository

Clone your fork to your local machine



$ git clone git@github.com:gjwgit/pname.git $ cd pname

Add 'upstream' repo to list of remotes



$ git remote add upstream
https://github.com/UPSTREAM-USER/ORIGINAL-PROJECT.git

Verify the new remote named 'upstream'

$ git remote -v

Fetch from upstream remote



$ git fetch upstream

View all branches, including those from upstream



$ git branch -va

Checkout your master branch and merge upstream



$ git checkout master 
$ git merge upstream/master

Checkout the master branch - you want your new branch to come from master



$ git checkout master

Create a new branch named newfeature (give your branch its own simple informative name)



$ git branch newfeature

Switch to your new branch



$ git checkout newfeature

DO YOUR WORK

Fetch upstream master and merge with your repo's master branch



$ git fetch upstream 
$ git checkout master 
$ git merge upstream/master

If there were any new commits, rebase your development branch:

$ git checkout newfeature
$ git rebase master

Rebase all commits on your development branch:

$ git checkout
$ git rebase -i master

On github change to branch and click Pull Request.


Copyright © 1995-2019 Togaware Pty Ltd
Support further development through the purchase of the PDF version of the book.
Brought to you by Togaware and the author of open source software including Rattle and wajig.
Also the author of Data Mining with Rattle and Essentials of Data Science.