有没有办法在终端中列出git存储库? [英] Is there any way to list up git repositories in terminal?
问题描述
我的系统上有几个git仓库,我想把它们全部列入终端。
I have several git repositories on my system and I want to list them all in terminal.
我在找的是这样的:
/ path / to / my / git / repo / 1 / REPONAME1
/ path / to / my / git / repo / 2 / REPONAME2
/ path / to / my / git / repo / 3 / REPONAME3
/path/to/my/git/repo/1/ REPONAME1
/path/to/my/git/repo/2/ REPONAME2
/path/to/my/git/repo/3/ REPONAME3
如果您能想出如何显示分行名称和回购状态, [master] c:0 u:1 d:0,那真是太棒了。
If you can come up with how to show branch name and repo's status eg. [master] c:0 u:1 d:0, that would be great.
推荐答案
在你的系统上,你可以在bash shell终端(在命令行)运行以下命令并找到它们。
To list all the git repositories you have on your system you can run the following command in a bash shell terminal (at the command line) and find them.
find / -name .git -type d -exec dirname {} \;
这篇关于有没有办法在终端中列出git存储库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!