我搞砸了,将一个分支推送到 bitbucket,这不是主分支。
我无法创建新的存储库,而且我对这个存储库的访问权限有限。我尝试重命名它。我最终删除了 .git 文件夹,现在我无法推送或 pull 该分支。当我试图 pull 它说:
(files)...
Please move or remove them before you can merge.
Aborting
我想要一个名为 main 的分支(作为主要分支),然后是从它分支出来的 cms-fe。
有人能帮我摆脱困境吗?
最佳答案
I want to have branch named main (as the main branch) and then cms-fe that branches out from it.
由于您没有管理员权限,我们将不得不重命名您的分支,而不是使用新名称推送它:
# rename the local branch
git branch -m cms-fe main
现在分支有了新名称,我们将把新名称推送到远程
git push origin main
现在我们将删除您使用旧名称推送的旧分支
git push origin :cms-fe
从主干分支出来
git checkout main
git checkout -b cms-fe
# upload the branch to the remote server
git push origin cms-fe
关于git - 更改 bitbucket 中的主要分支?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41890107/