Renaming local and remote

Rename the local branch to the new name

git branch -m <old_name> <new_name>

Delete the old branch on remote - where is, for example, origin

git push --delete <old_name>

Or shorter way to delete remote branch [:]

git push :<old_name>

Push the new branch to remote

git push <new_name>

Reset the upstream branch for the new_name local branch

git push -u <new_name>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章