English 中文(简体)
是否具备了根据名录检查多个箱子回收功能?
原标题:Is there any functionality in git to check multiple git repos under a directory?

我在一份目录下转播了多根基,我想知道,在编造每张名录方面是否有某种功能,检查是否有任何未经批准的变化,并向我报告这些变化?

我可以每天早上发言,以确保所有事情都到来。

就在任何一天,我就忙于进行多次重新思考,而我却忘记进行我的变化,如果我不久就兑现承诺,那会造成冲突。

Chris

最佳回答

Andy 是正确的(在评论中):如果母体目录本身是母体背书的根基,所有子子公司都是子产品,那么 g的地位就可以发现其中之一的任何变化。

You can also use (with submodules) git diff

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

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

问题回答

I wrote a command-line tool gita for this purpose. It can display the status of all repos, including the edit status, the relation to remote branch, etc. It also batch executes commands from any working directory.

You can also group the repos. For your project structure, you can run

gita add -r <root>

which will automatically add the subordinate repos into a group.

Then gita ll root will display the relevant information. gita <command> root will batch run the command on repos in the root group. You can surely run command on specified repos from any working directory too.

There are other functionalities such as setting context, defining custom commands, etc. Installation is pip3 install -U gita. You can find more information on github.

“entergraph

<代码>gita ll的指挥显示,在分支名称旁边有3个可能的标志,表明

  • +: staged changes
  • *: unstaged changes
  • _: untracked files/folders

分支机构名称有5种方式。

color meaning
white local has no remote
green local is the same as remote
red local has diverged from remote
purple local is ahead of remote (good for push)
yellow local is behind remote (good for merge)

在您的<代码>.gitconfig文档中添加这些内容,然后,从母体名录中操作git status-all,以便重新获得所有储存库的地位。

[alias]
status-all = "!for d in `find . -name ".git"`; do echo "
*** Repository: $d ***" && git --git-dir=$d --work-tree=$d/.. status; done"

I don t think git has this build in, thus some time ago I created a script to do this: https://github.com/mnagel/clustergit

允许你在多个仓库中一劳永逸地指挥。 重新利用双倍地位特别有用。 <代码>clustergit支持git status,git dra/code>,gitzan/code>, and more.

“entergraph

如果有人需要一行:

rootdir=$(pwd);for folder in $(ls -p | grep /);do cd "$rootdir/$folder";git status; cd $rootdir; done




相关问题
Tracking Versions, Builds, Revisions, with TortiseSVN

I am the sole developer on a project and have been using tortoiseSVN for quite a while. Now Id like to start getting version information working correctly in the project I.E. show Major Version, Minor ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

How to handle different csproj [closed]

I am working in a team of five. We are working on a C# application with five csprojects. The problem is that for each csproject, each of my colleagues has their own ideas on how to reference a DLL; ...

Changing username in SVN+SSH URI on the fly in working copy

I am using SVN+SSH to check out a working copy of repository from an SVN server on which all developers are members of a developer group and have full read/write permissions on the repository ...

How to search for file in subversion server?

Is there a way to search for a file in a subversion repository? Something similar to Unix find command, with which I can find the location of a file in a repository. I know there is svn list, but ...