Introduction
In order to check the status of git repositores, git status
could be issued from the root of a repository.
C:\path\to\git_repositories\git_repo_1>git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
If a directory consists of multiple, e.g. 50 git repositories
C:\path\to\git_repositories>dir
Directory of C:\path\to\git_repositories
.ssh
git_repo_1
...
git_repo_50
0 File(s)
51 Dir(s)
Nor
C:\path\to\git_repositories>git status .
fatal: Not a git repository (or any of the parent directories): .git
neither
C:\path\to\git_repositories>git status ./.
fatal: Not a git repository (or any of the parent directories): .git
is able to check the status of all repositories
Question
How to check the status of all git repositories at once?
You can find the list of all local git repositories by navigating from “Git > Local Repositories.” Based on the previously configured folder for the local repos, Visual Studio will change the context for the local repositories.
Use the git status command, to check the current state of the repository.
The git log command is Git's basic tool for exploring a repository's history. It's what you use when you need to find a specific version of a project or figure out what changes will be introduced by merging in a feature branch.
The git status command only outputs information, it won't modify commits or changes in your local repository.
I went with:
find . -name .git -execdir bash -c 'echo -en "\033[1;31m"repo: "\033[1;34m"; basename "`git rev-parse --show-toplevel`"; git status -s' \;
I think it's nicer because treats directories recursively.
Edited to show the name of the repo in a cleaner way.
As of 2.34 the for-each-repo
command allows running git commands across a list of repos defined in a multi-valued config.
Example config:
[myRepos]
repo = /full/path/without/expansion/repo1
repo = ../can/be/relative/repo2
[alias]
all = for-each-repo --config=myRepos.repo
Then you can run git all status
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With