1.環境
ubuntu16.04 gerrit
2.問題
在gerrit上提交代碼,在patch未合並之前,本地文件丟失,從遠程下載后繼續修改,
並提交到之前的repository.
3.解決方法
3.1. create a floder(where the remote patch will locate), and run "git init" in this new floder.
3.2 configure remote repository. run "git remote add gerrit https://Launchpad_id@review.openstack.org/openstack/tricircle.git"
(Launchpad_id is your own launchpad id)
3.3 download the remote patch. run "git review -d patch_number".
3.4 then the remote files are downloaded to local respository. Just like the beginning of the your development. edit it as you planned.
3.5 run "git add .".
3.6 run "git commit -a --amend".
3.7 run "git review".
(其中,如果在其他機器上操作,需要配置user.name 和user.email。在自己的機器上,會用已配置好的。branch也會用已配置的。
git review需要HTTP password for Launchpad_id.此密碼不是launchpad郵箱賬號的密碼,登錄github,有HTTP password,即是
該密碼)