推开窗户上的gerrit

Nik*_*las 15 windows git repository gerrit

我正在努力用TortoiseGit将我的一些数据推向一个gerrit.我创建了一个新的仓库并将其交给了主人.我添加了一个遥控器,带有我的私钥,我也上传了公钥.

从gerrit中拉出来是没有问题的,但是当我尝试推送时出现以下错误:

remote: Resolving deltas: 100% (96/96)
remote: Processing changes: refs: 1, done    
remote: ERROR: missing Change-Id in commit message
remote: Suggestion for commit message:
remote: Initial Commit
remote:
remote: Change-Id: Icb5f79b9a32abc77a99f0034ecc6a5a9ae9ef1c6
remote: Hint: To automatically add a Change-Id to commit messages, install the commit-msg hook:
remote: $ scp -p -P 29418 <server stuff>:hooks/commit-msg .git/hooks/
Run Code Online (Sandbox Code Playgroud)

最大的问题是,我生活在一个Windows世界,没有$ scp ....任何建议,我如何安装git hook或提交一个提交ID?

顺便说一句git hooks --install回报'hooks' is not a git command

unc*_*all 20

只需从以下位置下载:http://www.example.com/r/tools/hooks/commit-msg然后将其复制到.git/hooks文件夹即可.

或者你可以从gerrit评论下载它

- 更新 -

如果在本地提交之后添加提交挂钩(可能就是这种情况),则需要修改上次提交.只需修改上次提交而不进行任何实际更改,就会将Change-ID添加到日志消息中.

  1. git commit -a --amend
  2. git log -1 //这是为了检查日志消息中是否存在Change-ID
  3. git push origin HEAD:refs/for/master

- 更新2 -

如果你像我一样并且在创建克隆时有很多项目,你可能想要设置你的git安装,所以默认安装了commit-msg钩子.您可以通过将commit-msg复制到git模板文件夹来完成此操作.在我的Win7系统上,可以在这里找到:

C:\Program Files (x86)\Git\share\git-core\templates\hooks

下次创建新克隆时,无需再次下载commit-msg.