Skip to content

Instantly share code, notes, and snippets.

@burnash
Last active May 15, 2016 18:12
Show Gist options
  • Save burnash/f684b7b0f03547ddc4d6b37b5d366b7c to your computer and use it in GitHub Desktop.
Save burnash/f684b7b0f03547ddc4d6b37b5d366b7c to your computer and use it in GitHub Desktop.
Move a Git branch out into its own repository
mkdir repo-name.git
cd repo-name.git
git --bare init
cd /path/to/existing/repo
git push /path/to/repo-name.git branch-to-move:master
# Add remote
cd /path/to/repo-name.git
git remote add origin https://github.com/username/repo-name.git
# Push to remote
git push -u origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment