我从开发中创建了一个功能分支。它看起来像这样:
以前,当我创建功能分支时,它也会显示在 Remote 上,但现在不存在了。现在,当我尝试 push SourceTree 时,出现以下错误:
To https://<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1a7763747b777f3777637975776a7b74635a78736e786f79717f6e3475687d" rel="noreferrer noopener nofollow">[email protected]</a>/mycompany/projectname.git
! [remote rejected] feature/data_utilities -> feature/data_utilities (failed to write)
error: failed to push some refs to 'https://<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e984908788848cc484908a868499888790a98b809d8b9c8a828c9dc7869b8e" rel="noreferrer noopener nofollow">[email protected]</a>/mycompany/projectname.git'
我也尝试过命令行...
git push origin feature/data_utilities
...但我得到了相同的结果。当我查看 BitBucket 时,功能分支不存在。
最佳答案
我不使用 BitBucket,但从命令行创建功能分支的过程非常简单。
git checkout develop
git checkout -B feature_branch
# This command creates a new branch and switches context to the newly created branch
git push -u origin feature_branch
# This will create the branch on origin and set it up to be a tracking branch
关于git - 无法在 git 中推送功能分支,远程中不存在?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31864292/