不能在git中推送功能分支,在远程中不存在吗? [英] Can't push feature branch in git, doesn't exist in remote?

查看:527
本文介绍了不能在git中推送功能分支,在远程中不存在吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个来自development的功能分支.看起来像这样:

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

以前,当我创建功能分支时,它也显示在遥控器上,但是现在不存在.现在,当我尝试推入SourceTree时,出现以下错误:

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

...但是我得到了相同的结果.当我查看BitBucket时,功能分支不存在.

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

推荐答案

我不使用BitBucket,但是从命令行创建功能分支的过程非常简单.

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

这篇关于不能在git中推送功能分支,在远程中不存在吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆