Created
May 5, 2021 12:26
-
-
Save uilian/ece87516fb2f2c9a92327a7a74dedad7 to your computer and use it in GitHub Desktop.
Rename git branch local and remote
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
git checkout branch_to_be_renamed | |
git branch -m branch_to_be_renamed new_branch_name | |
git push origin --delete branch_to_be_renamed | |
git push origin -u new_branch_name | |
###### | |
# -u, --set-upstream | |
# For every branch that is up to date or successfully pushed, add upstream (tracking) | |
# reference, used by argument-less git-pull(1) and other commands. For more information, see | |
# branch.<name>.merge in git-config(1). | |
##### |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment