公司使用Gerrit来进行代码Review
同事提交了大量代码的时候 如果不能在本地进行调试 只用web端来review看不出个所以然来
在stackoverflow上查阅到解决方案
id就是网址链接里的id
http://code.xxxxxxxx.com/#/c/1086216/
PowerShell代码
$id=1086216
$change=git ls-remote origin "refs/changes/*/$id/*"
$refs=$change.Substring($change.LastIndexOf("refs"),$change.Length-$change.LastIndexOf("refs"))
git pull origin $refs
git rebase
Git Bash里原始命令:
git ls-remote origin 'refs/changes/*/1086216/*'
git pull origin refs/changes/16/1086216/1
git rebase
附原网址:
https://stackoverflow.com/questions/28370567/how-to-git-pull-a-given-patch-set-from-gerrit