在 Gerrit 代码审查中更改消息

发布于 2024-10-27 03:59:18 字数 455 浏览 6 评论 0原文

我已经向 gerrit 提交了一个分支。版主已经批准了我的代码,但尚未将其合并到主存储库中。我尝试更改提交中的消息,但不断收到奇怪的错误。这是我所做的:

1)git checkout FETCH_HEAD(为了签出分支的最新更改,我必须在提交更改后运行repo同步,这会撤消我的更改,因此必须获取并签出才能取回我的更改)

2 ) git commit --修改 *打开一个文本编辑器,我在那里更改了我的消息

3) 存储库上传

当我尝试 #3 时,它给了我这样的消息:“没有准备好上传的分支”

我以为我做的检查是我的分支将被称为 FETCH_HEAD?现在,我需要再次运行 repo start 命令吗?这会导致 gerrit 审查系统中出现一个新条目还是只是添加一个新补丁?我不希望版主认为我更改了文件,从而让他们再次审查所有内容。/我只想更改提交消息,仅此而已。

有什么想法我做错了吗?

I've commited a branch to gerrit. Moderators have already approved my code but not merged it yet into the main repository. I tried altering the message on my commit but I keep getting strange errors. Here's what I've done:

1) git checkout FETCH_HEAD (to checkout the latest changes to a branch, I had to run repo sync after I commited my changes which undid my changes so had to fetch and checkout to get my changes back)

2) git commit --amend
*opens a text editor and I changed my message there

3) repo upload

When I try #3, it gives me this message: "no branches ready for upload"

I thought my doing a checkout that my branch would be called FETCH_HEAD? Now, do I need to run the repo start command again? Will this cause a new entry in the gerrit review system or will it just add a new patch? I don't want the moderators to have to think that I altered the files, thereby having them review everything again./ I just want to change the commit message, nothing else.

Any ideas what I am doing wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

笑饮青盏花 2024-11-03 03:59:18

我认为您在创建新分支时缺少 --track 选项。正在创建您的分支,但未跟踪上传。使用 repo start 作为替代方案。

I think what you are missing is the --track option while creating a new branch. Your branch is being created but not being tracked for upload. use repo start as an alternative.

孤星 2024-11-03 03:59:18

我认为repo upload需要一个跟踪分支。当我遇到这个问题时,我切换回“master”分支并将我的更改合并到其中。我能够从那里进行存储库上传

I think repo upload requires a tracked branch. When I had this problem, I switched back to the "master" branch and merged my changes into it. I was able to do the repo upload from there.

懷念過去 2024-11-03 03:59:18

git checkout FETCH_HEAD 不会创建分支 - 相反,它会将您的客户端置于“分离的 HEAD”状态。如果需要,您需要手动创建一个分支(使用 git checkout -b)。

git checkout FETCH_HEAD doesn't create a branch - instead, it puts your client into a "detached HEAD" state. You need to manually create a branch (with git checkout -b <branchname>) if you want one.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文