我们有一个名为 的分支ABC-Awsome_Branch,它“保存”在 中feature/3.0.0,所以它看起来像:feature/3.0.0/ABC-Awsome_Branch
但是分支是用错误的名称创建的,甚至不在正确的文件夹中。所以正确的路径/名称必须是这样的:feature/2.5.0/DEF-Awsome_Branch. 现在这个分支包含一些提交等...
是否可以“移动”并将分支重命名为正确的名称和路径?
我们使用 Bitbucket 和 sourcetree。
这应该可以解决问题:
Run Code Online (Sandbox Code Playgroud)git branch -m old_branch new_branch # Rename branch locally git push origin :old_branch # Delete the old branch git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
在执行此操作之前不要忘记拉动,这样您就不会丢失之前未拉动的任何东西。
| 归档时间: |
|
| 查看次数: |
4054 次 |
| 最近记录: |