This article provides much better and more detailed instructions:
http://www.nearform.com/nodecrunch/first-time-with-open-source/
Here is my setup, but feel free to use whatever works best for you. You need to run this once for each new repository (project) you fork on GitHub:
-
Fork a repo via Github UI (e.g.
strongloop/loopback
->bajtos/loopback
). For more detailed instructions, see GitHub's Fork an example repository. Ignore GitHub's instructions for setting up a local clone, follow my instructions below. -
Clone the forked repo locally, this creates remote called "origin"
git clone [email protected]:bajtos/loopback.git
cd loopback
- Add upstream remote
git remote add upstream [email protected]:strongloop/loopback.git
- Configure master to track upstream (strongloop), not your fork:
git config branch.master.remote upstream
Now you are set to create a new feature branch, see below.
Whenever you start working on a new pull request, create a new feature branch dedicated to this pull request.
Here are the most important commands:
- create a new branch
git checkout -b branch-name
- push the new branch to github
git push -u origin branch-name
- switch to a different branch
git checkout another-branch-name
See the following page for more info, you can ignore the merging part: http://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging
To get you started with pull-request based workflow: