Skip to content

Instantly share code, notes, and snippets.

@sezabass
Last active June 17, 2021 15:34
Show Gist options
  • Save sezabass/f9ddc64acef903611cac9f280a1e0954 to your computer and use it in GitHub Desktop.
Save sezabass/f9ddc64acef903611cac9f280a1e0954 to your computer and use it in GitHub Desktop.
Linux alias for git rename remote branch
git-rename-remote-branch() {
currentbranch="$(git branch --show-current)" # not the best method for scripting
git branch -m $1
git push origin :$currentbranch $1
git push origin -u $1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment