Skip to content

Instantly share code, notes, and snippets.

@wouterj
Created October 7, 2013 15:58
Show Gist options
  • Select an option

  • Save wouterj/6870292 to your computer and use it in GitHub Desktop.

Select an option

Save wouterj/6870292 to your computer and use it in GitHub Desktop.

With Git

Setup

You have 2 remotes:

$ git remote add wouterj https://github.com/WouterJ/symfony-cmf-docs

$ git remote add origin https://github.com/symfony-cmf/symfony-cmf-docs

Updating

When you want to update your fork, checkout the branch to update:

$ git checkout master

Then fetch the origin:

$ git fetch origin

And merge the fetched branch:

$ git merge origin/master

Now, the branch master is up to date.

Creating PR

To create a new PR, create a new branch for that PR:

# be sure you are on master
$ git checkout master

# create and checkout a new branch, based on 'master'
$ git checkout -b my-new-awesome-pr

Pushing PR

# push to fork
$ git push wouterj my-new-awesome-pr

And create the Pull Request on GitHub.

With Git + Hub (a github tool)

See: http://github.com/github/hub

Setup

You have 2 remotes:

$ hub remote add WouterJ
$ hub remote add symfony-cmf

$ hub remote rename WouterJ wouterj
$ hub remote rename symfony-cmf origin

Updating

When you want to update your fork, checkout the branch to update:

$ git checkout master

Then fetch the origin:

$ git fetch origin

And merge the fetched branch:

$ git merge origin/master

Now, the branch master is up to date.

Creating PR

To create a new PR, create a new branch for that PR:

# be sure you are on master
$ git checkout master

# create and checkout a new branch, based on 'master'
$ git checkout -b my-new-awesome-pr

Pushing PR

# push to fork
$ git push wouterj my-new-awesome-pr

And create the Pull Request with hub:

$ hub pull-request
# opens a Vim editor with the PR title and description
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment