Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Eclipse eGit/ZendStudio 9生成的Refspec HEAD:refs/for/refs/heads/master是什么意思?_Eclipse_Git - Fatal编程技术网

Eclipse eGit/ZendStudio 9生成的Refspec HEAD:refs/for/refs/heads/master是什么意思?

Eclipse eGit/ZendStudio 9生成的Refspec HEAD:refs/for/refs/heads/master是什么意思?,eclipse,git,Eclipse,Git,在ZendStudio 9中从Git建立了一个项目。(基于eclipse和eGit) 它会生成一个安静的正常回迁参考规范: Remote Fetch Specification +refs/heads/*:refs/remotes/original/* Remote Push Specification HEAD:refs/for/refs/heads/master 但是一个非常神秘的推送参考规范: Remote Fetch Specification +refs/heads/*:r

在ZendStudio 9中从Git建立了一个项目。(基于eclipse和eGit)

它会生成一个安静的正常回迁参考规范:

Remote Fetch Specification  +refs/heads/*:refs/remotes/original/*
Remote Push Specification   HEAD:refs/for/refs/heads/master
但是一个非常神秘的推送参考规范:

Remote Fetch Specification  +refs/heads/*:refs/remotes/original/*
Remote Push Specification   HEAD:refs/for/refs/heads/master
在remote中,我可以通过“git ls remote”看到以下内容:

8db575549dea67a45cea04358f902993c940c4d8        HEAD
16f0939153e6ef12b4596f0d4fb43fa5b8b0246b        refs/for/refs/heads/master
8db575549dea67a45cea04358f902993c940c4d8        refs/heads/master
我在本地机器上看到了“git status”的消息:

所以,请注意,因为我的问题不是“它意味着什么”

我的问题是:

  • 这个工作流意味着什么?这是什么意思
  • 在服务器“refs/for..”上生成的Ref用于什么
  • 在本地分支上工作不是比在服务器上有一个ref来推送更好吗

提前感谢。

首先,通常与Gerrit相关的参考规范应该是(如“”)

所以,如果有什么的话,那应该是

HEAD:refs/for/master
但在您的情况下,您不需要这种refspec(因为您没有Gerrit)

这是一种常见的承诺方式吗

不,不是

这是一个糟糕的违约,一文不值吗

对你来说,是的,它没有用

这可能是上述内容的副作用:

事实上,Gerrit与EGit功能集成并一起提供。目前没有办法从Zend Studio中禁用Gerrit

大门还开着


委员会:

为了走出这个陷阱,我必须意识到,这个ref正在远程上创建一个分支,而没有与之关联的远程跟踪分支

但要摆脱它是相当容易的:

  • .git/config
    中的push-refspec更改为
    push=refs/heads/master:refs/heads/master
  • 将本地回购推送到远程
    git Push
  • 删除远程推送git上的分支--Delete origin refs/for/refs/heads/master

refs/for
由Gerrit code Review的工作人员使用,如图所示。我不确定我是否理解你的最后一个问题。。。你可以在当地分公司工作。推送规范可能是为了方便提交代码供审查。好吧,但是没有Gerrit,所以它没有意义,不是吗ZendStudio 9本可以进行正常克隆,让用户选择推送参考规范。->所以我的问题是针对这一点的:这是一种通常的提交方式,还是一个糟糕的默认值,一文不值?感谢您的启发,这是我需要的背景信息。好吧,为了走出这个陷阱,我必须意识到,这个ref正在远程创建一个分支,而没有与之相关联的远程跟踪分支。但要摆脱它非常容易:
将.git/config中的push-refspec更改为push=refs/heads/master:refs/heads/master
将本地回购推送到远程
git-push
删除远程
git-push上的分支--删除源refs/for/refs/heads/master
@tweini。我已将您的评论包含在答案中,以提高可视性。