[英]Run hg pull over all subdirectories
How can I update multiple mercurial (hg) repositories from their shared parent's directory?如何从共享父目录更新多个 mercurial (hg) 存储库?
/plugins/search
/plugins/overview
/plugins/chart
I want to change a branch to default one and update them all at once我想将一个分支更改为默认分支并一次更新它们
cd /plugins/search
hg update -C default
hg pull -u
Run the following from the parent directory, plugins
in this case:从父目录运行以下命令,在本例中为
plugins
:
find . -type d -maxdepth 1 -exec hg update -C default -R {} \;
find . -type d -maxdepth 1 -exec hg pull -u -R {} \;
To clarify:澄清:
find .
searches the current directory-type d
to find directories, not files -type d
查找目录,而不是文件-maxdepth 1
for a maximum depth of one sub-directory -maxdepth 1
表示一个子目录的最大深度-exec {} \\;
runs a custom command for every findhg update -C default -R {}
hg changes branch to default in each repository hg update -C default -R {}
hg 将每个存储库中的分支更改为默认值hg pull -u -R {}
hg updates to new branch head if changesets were pulled in each repository hg pull -u -R {}
如果在每个存储库中拉取了变更集,则 hg 更新到新的分支头find . -type d -iname .hg -exec echo \; -exec hg pull -u -R {}/.. \;
The initial -exec echo \\;
初始
-exec echo \\;
is only there to keep the output clean.只是为了保持输出清洁。
Click here for more find
galore .点击查看更多
find
嘉豪。
Run this command on your root directory of project which is plugin在插件项目的根目录上运行此命令
find .
寻找 。 -maxdepth 1 -type d -print -execdir git --git-dir={}/.git --work-tree=$PWD/{} pull origin develop;
-maxdepth 1 -type d -print -execdir git --git-dir={}/.git --work-tree=$PWD/{} 拉源开发;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.