Can't push feature branch in git, doesn't exist in remote?

a 夏天 提交于 2019-12-11 04:06:30

问题


I created a feature branch off of develop. It looks like this:

Previously when I made a feature branch, it also showed up on the remote, but now it's not present. Now, when I try to push in SourceTree, I get the following error:

To https://myname-mycompany@bitbucket.org/mycompany/projectname.git
 ! [remote rejected] feature/data_utilities -> feature/data_utilities (failed to write)
error: failed to push some refs to 'https://myname-mycompany@bitbucket.org/mycompany/projectname.git'

I also tried the command line...

git push origin feature/data_utilities

...but I got the same results. When I look on BitBucket, the feature branch doesn't exist.


回答1:


I don't use BitBucket, but the process for creating a feature branch from the command line is very simple.

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


来源:https://stackoverflow.com/questions/31864292/cant-push-feature-branch-in-git-doesnt-exist-in-remote

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!