Created
September 28, 2020 12:33
-
-
Save andmax/36c43635e37acc33526af7a70c211777 to your computer and use it in GitHub Desktop.
Rename an existing git branch
This file contains hidden or 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
1. The problem is to rename a git branch named <current_branch_name> | |
2. that already exists to a new name <new_branch_name>: | |
git checkout <current_branch_name> | |
git branch -m <new_branch_name> | |
git push origin -u <new_branch_name> | |
git push origin --delete <current_branch_name> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment