📌  相关文章
📜  重命名 git 分支远程和本地 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:51:39.842000             🧑  作者: Mango

代码示例1
# Rename the local branch to the new name
git branch -m  

# Delete the old branch on remote - where  is, for example, origin
git push  --delete 

# Or shorter way to delete remote branch [:]
git push  :

# Prevent git from using the old name when pushing in the next step.
# Otherwise, git will use the old upstream name instead of .
git branch --unset-upstream 

# Push the new branch to remote
git push  

# Reset the upstream branch for the new_name local branch
git push  -u