[Git] How to rename your remote branch

Rename your local foo branch with bar:

git branch -m foo bar

 

Remember this will add the new branch when you push, but it won’t delete the old foo remote branch.

Add -f --mirror to rename the branch on the remote:

git push origin -f --mirror

 

If you just want to remove your remote foo branch, just use:

 

git push origin :foo

 

posted @ 2017-04-18 19:06  Zhentiw  阅读(298)  评论(0编辑  收藏  举报