Last active
November 6, 2017 20:52
-
-
Save dflima/f8207d2632dc4c56a42d16e460461b77 to your computer and use it in GitHub Desktop.
Git alias to rename local and remote branches
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
# Put the code below on your .gitconfig file, under "alias" section. | |
# Usage: | |
# git rename old_branch_name new_branch_name | |
[alias] | |
rename="!f() { git branch "$2" origin/"$1" && git push origin --set-upstream "$2" && git push origin --delete "$1"; }; f" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment