Say someone has created a branch for you off of master, and they want to create Pull Requests (PRs) against it. Here’s how you do it.

Get on your fork (make sure sync’d and clean) and then do

git fetch remote branch
git checkout branch

So for example

git fetch upstream imessage
git checkout imessage

Screen Shot 2017-03-20 at 2.56.48 PM.png

This grabs the upstream branch, pulls it local, and then when you checkout a branch of the same name, it automatically sets it to the upstream branch you just checked out.

Now you can create a new branch off this one, do your work, and merge it back by creating a PR via GHE.

git checkout -b foo`

You are now ready to work

Screen Shot 2017-03-20 at 2.58.33 PM.png

IMG_1637.JPG

Advertisement