Skip to content

Instantly share code, notes, and snippets.

@nqthqn
Created September 7, 2014 16:31
Show Gist options
  • Save nqthqn/34adbe9cebfe7a15b077 to your computer and use it in GitHub Desktop.
Save nqthqn/34adbe9cebfe7a15b077 to your computer and use it in GitHub Desktop.
fork, upstream, remotes oh my!

#How to fork & clone

Go here and click "fork". This will basically make a copy of the repo for you. Then you can work completely in your own version.

git clone https://github.com/<username>/ipals.git

From there you can edit, add, commit, push, branch, etc.

#How to stay up to date with upstream

You will first need to add a remote. Here's an example:

nathann@glitch ipals (dev) $ git remote -v
origin	https://github.com/natsn/ipals.git (fetch)
nathann@glitch ipals (dev) $ git remote add upstream https://github.com/htrg/ipals.git
nathann@glitch ipals (dev) $ git remote -v
origin	https://github.com/natsn/ipals.git (fetch)
origin	https://github.com/natsn/ipals.git (push)
upstream	https://github.com/htrg/ipals.git (fetch)
upstream	https://github.com/htrg/ipals.git (push)
nathann@glitch ipals (dev) $ git pull upstream dev
From https://github.com/htrg/ipals
 * branch            dev        -> FETCH_HEAD
Merge made by the 'recursive' strategy.
 README.md            |  24 +++++-
 apps/import_pages.py | 222 +++++++++++++++++++++++++++++++++++----------------
 babynet.png          | Bin 0 -> 42492 bytes
 epals2.png           | Bin 0 -> 37641 bytes
 tree.png             | Bin 0 -> 77443 bytes
 tree2.png            | Bin 0 -> 44334 bytes
 6 files changed, 172 insertions(+), 74 deletions(-)
 create mode 100644 babynet.png
 create mode 100644 epals2.png
 create mode 100644 tree.png
 create mode 100644 tree2.png
nathann@glitch ipals (dev) $

Pulling from upstream will merge the changes made in upstream repo into yours. You can also do git fetch upstream dev if you do not want to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment