简体   繁体   English

运行 hg pull over 所有子目录

[英]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 find为每个查找运行一个自定义命令
  • hg 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 更新到新的分支头

Finding repositories deeper in the directory tree在目录树中查找更深的存储库

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM