将git仓库从Github自动移动到Gerrit [英] Move git repository from Github to Gerrit automatically

查看:293
本文介绍了将git仓库从Github自动移动到Gerrit的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

需要将现有的git repo推送到Gerrit,但是这样做有问题:

Need to push existing git repo to Gerrit however have issues doing this:

remote: ERROR: missing Change-Id in commit message footer

因为回购中不包含.git/hooks/commit-msg.现在,我已经安装了脚本,但是需要更改数百条提交消息以将Change-Id添加到任何地方.如何以最佳和最简便的方式自动进行制作? 可能的解决方案:

because repo did not contain .git/hooks/commit-msg. Now I have the script installed, however need to change hundreds of commit messages to add Change-Id everywhere. How to make it automatically in the best and easiest way? Possible solutions:

  1. 我看到一些此处的主题建议使用git rebase -i,但是它是交互式的,并且大多是手动过程.
  2. 其他可以将sed命令与git rebase一起用作提交消息编辑器.在我的情况下,确切的rebase命令是什么?
  3. 第三提议使用git filter-branch命令,但是它仅适用于当前分支上尚未提交的提交被推到上游分支.
  1. I see some topics here suggest to use git rebase -i, however it is interactive and mostly manual process.
  2. Others to use sed command with git rebase as commit message editor. What is the exact rebase command will be in my case?
  3. Third proposes to use git filter-branch command, however it works only for commits on a current branch that have not yet been pushed to an upstream branch.

是否还有其他解决方案,解决方案或建议?谢谢!

Any other solutions, fixes or suggestions for the above? Thanks!

推荐答案

您需要与Gerrit管理员进行交谈,并寻求权限将其直接推送到分支机构绕过审阅.解释一下您要做什么,告诉您暂时只需要此权限(执行"git push gerrit HEAD:refs/heads/master"命令后,可以删除该权限).

You need to do talk to the Gerrit administrators and ask for permission to push direct to branch bypassing review. Explain what you're trying to do telling that you just need this permission temporally (after the execution of the "git push gerrit HEAD:refs/heads/master" command the permission can be removed).

其他可能性:请请Gerrit管理员或有权推送到refs/heads/*(配置管理器曾经具有这种权限)的人来为您执行命令.

Other possibility: ask to the Gerrit administrators or someone who has permission to push to refs/heads/* (configuration managers use to have such permission) to execute the command for you.

请勿追溯更改过去的提交,这不是一个好主意.

Do NOT change retroactively the past commits, this isn't a good idea.

这篇关于将git仓库从Github自动移动到Gerrit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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