git branch rename

1. Local branch rename

Git branch -m oldbranchname newbranchname

 

2. Rename the remote branch (assuming the local branch and the remote corresponding branch have the same name)

a. Rename the local branch corresponding to the remote branch

git branch -m old-local-branch-name new-local-branch-name

b. Delete the remote branch

git push origin  :old-local-branch-name

c. Upload the newly named local branch

git push origin  new-local-branch-name: new-local-branch-name

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326786187&siteId=291194637