Git missing Change-Id in commit message footer [How to Solve]

Git missing change ID in commit message footer solution
when git submits code to the server, the following error appears
missing change ID in commit message footer

cause: the commit MSG file is missing in the. Git/hooks directory of the project warehouse
solution 1: generally, when an error is reported in the submitted code, the corresponding solution prompt will be given

remote: Processing changes: refs: 1, done 
remote: ERROR: missing Change-Id in commit message footer
remote: Hint: To automatically insert Change-Id, install the hook:
remote: gitdir=$(git rev-parse --git-dir); scp -p -P 29418 xxxxx@xxxx:hooks/commit-msg ${gitdir}/hooks/
remote: And then amend the commit:
remote: git commit --amend

as shown above, you can solve the problem by inputting the following commands under the project path in turn:

gitdir=$(git rev-parse --git-dir); 
# Replace xxxxx@xxxx with the corresponding username and server (this command copies the commit-msg file from the server)
scp -p -P 29418 xxxxx@xxxx:hooks/commit-msg ${gitdir}/hooks/
# Commit again to generate change-id
git commit --amend

Solution 2: in fact, it is similar to the above method. If the current project has a backup, directly copy the. Git/hooks/commit MSG of the backup project to the corresponding directory of the current project

Similar Posts: