-
-
Save raogrr/51255db862fe028f9542c466b69eca08 to your computer and use it in GitHub Desktop.
Get a nice list of git repository statuses using the repo tool. #repo #git #git-status
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get a list of all the repos | |
repo forall -c 'echo $REPO_PROJECT; git status -s' | |
# Just list the changed repos | |
repo forall -c 'if [ "$(git status --porcelain)" != "" ]; then echo $REPO_PROJECT; fi' | |
# Print the contents, also only include projects from given list | |
repo forall $(cat projects) -c 'if [ "$(git status --porcelain)" != "" ]; then echo $REPO_PROJECT; git status -s; fi' | |
# Check both branch and (un)staged commits | |
repo forall -c repo-diff |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
case `git status` in | |
"HEAD detached at"*|"Not currently on any branch."*) | |
if [ "`git status --porcelain`" != "" ]; then | |
echo "$REPO_PROJECT has changes" | |
fi | |
;; | |
*) echo "$REPO_PROJECT not at detached state" | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment