Rename a branch in GIT / BitBucket

 The commands which works for me to rename a branch in GIT

  1. Rename a local branch first : git branch -m <old-name> <new-name>
  2. Delete remote branch : git push origin :<old-name>
  3. Push new branch to remote: git push origin <new-name>
  4. Reset the upstream branch to a new name: git push origin -u <new-name>

Thanks.
 

Comments

Popular Posts