Last active
December 27, 2015 23:59
-
-
Save eliza-abraham/7410620 to your computer and use it in GitHub Desktop.
Create new local branch for existing remote branch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Clone the target repository to your local computer. | |
$ git clone git@github.com:<username>/<project name>.git | |
Create a new oprhan branch | |
$ git checkout --orphan NEWBRANCH | |
Delete everything in it. | |
$ git rm -rf . | |
Merge/Pull the remote branch orphan branch into the local orphan branch | |
$ git merge BRANCHNAME | |
$ git pull origin BRANCHNAME | |
After committing push it to the target repository. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment