Created
October 4, 2023 18:47
-
-
Save organom/06abec04c7eebe325b6c206538fab7ef to your computer and use it in GitHub Desktop.
Renames a git 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
!#/bin/bash | |
function git-rename() { | |
if [ $# -lt 2 ] | |
then | |
echo "Usage: $0 old_branch_name new_branch_name"; | |
else | |
git branch -m $1 $2 | |
git push origin :$1 $2 | |
fi | |
} | |
git-rename $1 $2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment