Wednesday, September 18, 2013

What is the difference between origin and upstream in github

This should be understood in the context of GitHub forks (when you clone a GitHub repo at GitHub, before cloning that fork locally)
From the GitHub page:
When a repo is cloned, it has a default remote called origin that points to your fork on GitHub, not the original repo it was forked from.
To keep track of the original repo, you need to add another remote named upstream
git remote add upstream git://github.com/user/repo.git
You will use upstream to fetch from the original repo (in order to keep your local copy in sync with the project you wanted to contributed to).
You will use origin to pull and push since you can contribute to your own repo.
You will contribute back to the upstream repo by making a pull request.
fork and upstream

No comments:

Post a Comment