Gerrit error when Change-Id in commit messages are missing

前端 未结 12 1186
北荒
北荒 2020-11-28 03:58

I set up a branch in the remote repository and made some commits on that branch. Now I want to merge the remote branch to the remote master.

Basically follows are my

12条回答
  •  独厮守ぢ
    2020-11-28 04:22

    If you need to add Change-Id to multiple commits, you can download the hook from your Gerrit server and run these commands to add the Change-Ids to all commits that need them at once. The example below fixes all commits on your current branch that have not yet been pushed to the upstream branch.

    tmp=$(mktemp)
    hook=$(readlink -f $(git rev-parse --git-dir))/hooks/commit-msg
    git filter-branch -f --msg-filter "cat > $tmp; \"$hook\" $tmp; cat $tmp" @{u}..HEAD
    

提交回复
热议问题