1). 檢查倉儲.git/hook下面是否有 commit-msg 文件,若是沒有到下面的地址下載:python
http://review.cyanogenmod.org/tools/hooks/commit-msg
https://gerrit-review.googlesource.com/tools/hooks/commit-msgandroid
若是有本身的gerrit-review服務器,能夠直接在網址後面加上 /tools/hooks/commit-msg
便可下載。git
添加後,每次執行git commit 都會自動在log裏面生成 Change-Id,用於gerrit code review。服務器
2). 若是是repo sync 下來的代碼,隨便找一個倉儲,按上面的方法,檢查是否存在 commit-msg 軟連接(repo sync 是在每一個倉儲.git/hooks下面建立的軟連接),若是不存在,修改工程目錄下面 .repo/manifest.xml
,注意這個xml文件也是軟連接。學習
<remote name="aosp" review="review.source.android.com" fetch=".." /> <default revision="master" remote="aosp" sync-j="4" />
注意必須添加上面的 review="review.source.android.com"
這句。至於爲何,能夠查看.repo/repo 下面的 python腳本。fetch