Last active
January 2, 2018 08:57
-
-
Save wadouk/fc33108c35463baa8a7cd6596a68ff84 to your computer and use it in GitHub Desktop.
allow to execute a command in all subfolders that are git repos
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
if [ -d "$HOME/.userbin" ] ; then | |
for i in $(ls $HOME/.userbin/*); do source $i; done | |
fi |
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
#!/usr/bin/env bash | |
function forall() { | |
export args="${@}" | |
find . -maxdepth 2 -name .git -print0 | xargs -0 -I {} sh -ca ' | |
echo -e "\033[1;34m$(dirname {})\033[m " \ | |
&& cd $(dirname {}) \ | |
&& $args; | |
[ $? -ne 0 ] && echo "FAIL"; | |
cd ..; | |
' | |
unset args; | |
} |
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
remove_merged_granches() { | |
git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment