Skip to content

Instantly share code, notes, and snippets.

@joshavant
Created April 22, 2013 21:53
Show Gist options
  • Select an option

  • Save joshavant/5438878 to your computer and use it in GitHub Desktop.

Select an option

Save joshavant/5438878 to your computer and use it in GitHub Desktop.
branch_to_fork.md

Creates a new branch on a secondary Git repo (i.e. fork) with the contents of a branch from a primary repo:

git fetch SOURCE_REMOTE SOURCE_BRANCH:NEW_BRANCH_NAME; git checkout NEW_BRANCH_NAME; git branch -u TARGET_REMOTE NEW_BRANCH_NAME

i.e. git fetch origin 3.7.0:foobar-feature; git checkout foobar-feature; git branch -u fork foobar-feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment