1.
echo "SYNC-START"; rm -f /tmp/myfifo;mkfifo /tmp/myfifo; p=$(repo list|wc -l); (echo $((p-1))>/tmp/myfifo &); repo forall -c 'while [ `ps -Cgit -oargs=|grep -c "git push"` -gt 4 ]; do echo "*queue full*";sleep 1;done; (git push -f origin HEAD:refs/heads/xx&); read p/tmp/myfifo &); else while [ `ps -Cgit -oargs=|grep -c "git push"` -ne 0 ]; do echo "*waiting jobs*"; sleep 1; done; echo "SYNC-DONE"; fi'
2.
repo forall -pvc 'git push -f origin HEAD:refs/heads/xx4'
红色部分新创建的branch,等命令行执行完了就可以sync了
repo init -u ssh://android.YY.com/manifests -b xx
repo sync -c
XX YY具体情况要看公司配置
上面两种Push方法是针对有直接push权限的如果没有的话 只能push到gerrit 然后走review权限
1.
echo "SYNC-START"; rm -f /tmp/myfifo;mkfifo /tmp/myfifo; p=$(repo list|wc -l); (echo $((p-1))>/tmp/myfifo &); repo forall -c 'while [ `ps -Cgit -oargs=|grep -c "git push"` -gt 4 ]; do echo "*queue full*";sleep 1;done; (git push -f origin HEAD:refs/for/xx&); read p/tmp/myfifo &); else while [ `ps -Cgit -oargs=|grep -c "git push"` -ne 0 ]; do echo "*waiting jobs*"; sleep 1; done; echo "SYNC-DONE"; fi'
2.
repo forall -pvc 'git push -f origin HEAD:refs/for/xx'
近期做的项目就没有开发给我gerrit push权限 只能采用这样的方式由合作公司的SCM PM 代码review后merge
阅读(1938) | 评论(0) | 转发(0) |