不能直接重命名远程分支,只有先删旧的,再推新的。
# Rename the local branch to the new name
git branch -m <old_name> <new_name>
# Delete the old branch on remote - where <remote> is, for example, origin
git push <remote> --delete old_name
# Push the new branch to remote
git push <remote> new_name
# Reset the upstream branch for the new_name local branch
git push <remote> -u new-name
本文详细介绍了如何在Git中重命名远程分支。由于Git不直接支持远程分支的重命名,文章提供了具体步骤:首先在本地重命名分支,然后删除远程的旧分支,最后推送新的分支名称到远程仓库。
1158

被折叠的 条评论
为什么被折叠?



