git中是否有任何功能来检查目录下的多个git仓库? [英] Is there any functionality in git to check multiple git repos under a directory?

查看:238
本文介绍了git中是否有任何功能来检查目录下的多个git仓库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个目录下有多个git repos,我想知道git中是否有一些功能来迭代每个目录,检查是否有任何未提交的更改并将它们报告给我?

I've got multiple git repos under a directory, and I was wondering whether there was some functionality in git to iterate each directory, check whether there are any uncommitted changes and report those to me?

我每天早上都可以运行这个程序,以确保一切都是最新的。

I could run this every morning to ensure everything is up to date.

只是在任何一天,我都会工作有多次回购,我会忘记提交我的更改,这可能会导致冲突,当我很快意识到提交时会发生冲突。

It's just that on any one day, I'll be working with multiple repos and I'll forget to commit my changes, which can cause conflicts when I realise much later on to commit them.

Chris

推荐答案

安迪是正确的(在评论中) :如果父目录本身是父目录的根目录,所有子目录都是子目录,那么git status可以检测其中一个目录中的任何更改。

Andy is right (in the comments): if the parent directory is itself the root directory of a parent repo, with all the subdirectories as submdules, then git status can detect any changes in one of them.

您也可以使用(使用子模块) git diff

You can also use (with submodules) git diff

git submodule foreach --recursive git diff --name-status

如果没有子模块,请参阅 git:在目录树中找到所有未定位的本地人回购站

Without submodules, see a scripting solution at "git: Find all uncommited locals repos in a directory tree".

这篇关于git中是否有任何功能来检查目录下的多个git仓库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆