Recursive Git push/pull?

后端 未结 5 1659
迷失自我
迷失自我 2021-02-02 10:21

I have a git repository that contains other git repositories. Are there commands that recursively push and/or pull for not only the meta-repository but the sub-repositories?

5条回答
  •  广开言路
    2021-02-02 10:44

    I find myself in the same situation whenever I want to update my llvm/clang repositories and with a bit of bash help I can 'git pull' each of them like this:

    $> for dir in $(find . -name ".git"); do cd ${dir%/*}; git pull ; cd -; done

    This will 'git pull' all git repos found under your current directory, and probably wont work if they are bare repositories.

提交回复
热议问题