Skip to content

Instantly share code, notes, and snippets.

@itsabdessalam
Created April 5, 2020 06:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itsabdessalam/896aea0e6f767531b7cdfd46758b3996 to your computer and use it in GitHub Desktop.
Save itsabdessalam/896aea0e6f767531b7cdfd46758b3996 to your computer and use it in GitHub Desktop.
Git rename branch
git branch -m old new
git push origin :old
git push --set-upstream origin new
# alias
alias gmv='mv() { git branch -m $1 $2; git push origin :$1; git push --set-upstream origin $2; }; mv'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment