Skip to content

Instantly share code, notes, and snippets.

@jVirus

jVirus/gitrename.sh

Created May 9, 2019
Embed
What would you like to do?
Git branch renaming [local & remote]
git branch -m old_branch new_branch # First, rename branch locally
git push origin :old_branch # Then, delete the outdated branch
git push --set-upstream origin new_branch # And finally, push the new branch. Also, the new remote needs to be tracked, that is why we set set local branch to do so.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.