Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.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
Git 添加分支以供审查_Git_Github_Git Branch_Gerrit - Fatal编程技术网

Git 添加分支以供审查

Git 添加分支以供审查,git,github,git-branch,gerrit,Git,Github,Git Branch,Gerrit,我是Gerrit的新手 我所做的: // cloned repo git clone repo.git // created branch git checkout -b "test" // made some changes created textfile1.txt // added to stage git add . // commited git commit -m "adding new file" // pushed to gerrit git push origin t

我是Gerrit的新手

我所做的:

// cloned repo
git clone repo.git

// created branch
git checkout -b "test"

// made some changes
created textfile1.txt

// added to stage
git add .

// commited
git commit -m "adding new file"

// pushed to gerrit
git push origin test
现在,我的测试分支推到了gerrit,我如何将它添加到代码评审中

我正在阅读文档,为了将其添加到代码审阅中,您应该运行以下命令:

git push origin:HEAD/refs/for/master
这是否意味着我必须在总分/参考分/for/master branch上完成所有的开发工作


现在的解决办法是什么

进行提交的本地分支的名称无关紧要。这是你的个人工作区,你可以随意命名你的分支机构

Gerrit不用于检查分支,而是检查提交。如果您使用多个新提交推送一个分支(在您的示例中不是这样),您将在Gerrit中得到多个更改

是的,
git push origin HEAD:refs/for/master
是将更改推送到Gerrit进行审阅的常用习惯用法。这意味着“一旦获得批准并按Submit键,将当前负责人的所有新提交推送到主分支机构作为其目的地进行审查”


可能会有帮助?

这是
git-push-origin-HEAD:refs/for/master
,而不是
git-push-origin:HEAD/refs/for/master