Created
January 2, 2011 21:19
-
-
Save bonyiii/762824 to your computer and use it in GitHub Desktop.
git create remote tracking branch from local branch
This file contains hidden or 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
1; | |
git branch BranchName | |
git push origin BranchName | |
git -d BranchName | |
git branch --track BranchName origin/BranchName | |
# or | |
2; Backup all local branches to server | |
git config remote.backup.mirror true | |
git push --all backup | |
# or for only one branch as the first optio: | |
git branch backup-branch | |
git push origin backup-branch | |
# most elegant way: | |
git branch --set-upstream backup-branch origin/backup-branch | |
# or this: | |
# git branch -f backup-branch origin/backup-branch | |
# or this: | |
# git config branch.backup-branch.remote origin | |
# git config branch.backup-branch.merge refs/heads/backup-branch | |
# Original can be found here: http://stackoverflow.com/questions/3565674/git-remote-branch-tracking |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment