1. Switch to the local branch you want to rename
git checkout <old_name>
1
  1. Rename the local branch
git branch -m <new_name>
1
  1. Push the <new_name> local branch and reset the upstream branch
git push origin -u <new_name>
1
  1. Delete the <old_name> remote branch
git push origin --delete <old_name>
1

Powered by VuePress
Copyright 2010-2024 Thai Nguyen Hung all rights reserved.