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

Git Fork a Repository

20190611 A common workflow is to fork someone's original repository, make changes, and submit a pull request to the original repository for them to consider incorporating it into their master code base. You can fork the original repository through the github interface.

Once forked, clone the fork to your local machine and link it to the upstream repository:

$ git clone git@github.com:gjwgit/pygymn.git 
$ cd pygymn
$ git remote add upstream https://github.com/simonzhaoms/azface.git
$ git remote -v

Fetch updates from the upstream repository:

$ git fetch upstream

We can view all branches including those from upstream:

$ git branch -va

Now checkout your local master branch and merge from the upstream repository:

$ git checkout master 
$ git merge upstream/master

You may want to create a new named branch (give your branch its own simple informative name) within which to work, though this is optional:

$ git branch newfeature
$ git checkout newfeature

Once you have made your local changes, committed them and pushed to your repository, you can submit a git pull request to the upstream repository.


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.