git - 无法在 git 中推送功能分支,远程中不存在?

标签 git bitbucket atlassian-sourcetree

我从开发中创建了一个功能分支。它看起来像这样:

feature

以前,当我创建功能分支时,它也会显示在 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/

相关文章:

git - 如何判断 git 是否跟踪过文件 X

git - git pull 密码错误 - 重新提示密码?

ssh - 推送到远程服务器后执行 "hg update"?

git - 哪些分支应与 Azure 中的部署槽关联

git - 大测试数据文件和github

git - "git init"失败,怎么了?

c++ - 在 visual studio 中将源文件推送到 bitbucket

python - 无法从远程存储库读取。请确保您拥有正确的访问权限并且存储库存在

Git:在 merge 期间无法进行部分提交(SourceTree)

bitbucket - Sourcetree 使用两因素身份验证添加 bitbucket