Skip to content

PR from a Unique Branch

Sal Ferrarello edited this page Jun 15, 2015 · 1 revision

Change Your Branch

By default, all of your work is on the master branch. You'll want to make your changes on another branch rather than master (e.g. fix-mispell-apple-32). This is important because by leaving your master branch untouched, it is easy to create a another branch (e.g. `fix-mispell-year-33). Using this technique, you can have multiple PRs open at the same time against the same repo.

How to Create a New Branch

git status
git branch fix-mispell-apple-32
git checkout fix-mispell-apple-32
git status

git status

This line outputs something similar to

On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean

Notice, it tells you we are currently on the branch master

git branch fix-mispell-apple-32

This line creates a new branch called fix-mispell-apple-32 (even though we created the new branch, we are still on master, you can check with git status).

If you'd like to see all of your branches that currently exist, you can use git branch

git checkout fix-mispell-apple-32

This line switches to branch fix-mispell-apple-32. If you run git status after this, you'll see

On branch fix-mispell-apple-32

Push Your New Branch

Push your new branch up to GitHub

git push origin