Last active
November 26, 2015 21:16
-
-
Save kemayo/33d47bf4b260fa114f58 to your computer and use it in GitHub Desktop.
A git utility for my own use, here so I don't forget about it
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/bash | |
| for D in *; do | |
| if [ -d "${D}/.git" ]; then | |
| echo "${D}:" "${1:-pull}" "${@:2}" | |
| git -C "${D}" "${1:-pull}" "${@:2}" | |
| fi | |
| done |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Stick it somewhere on your $PATH.
> git foreach...will
git pullin all subdirectories of the current path which are a git repo.> git foreach push --tags...would
git push --tagsin all those repos.