Using Shell Command in Git Alias

Arunvel SriramArunvel Sriram
1 min read

We can prefix the Git Alias with ! to make it a shell command instead of sub-command to git.

git config --global alias.statuses \
'!for repo in $(find * -type d -maxdepth 0); do echo "\n=========$repo==========\n" && git -C $repo status; done'

Now git statuses command will get status of each Git repo in the current directory.

1
Subscribe to my newsletter

Read articles from Arunvel Sriram directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Arunvel Sriram
Arunvel Sriram

Software Engineer | Polyglot | DevOps | Open Source