Skip to content

Instantly share code, notes, and snippets.

@mkjsix
Last active March 28, 2018 16:01
Show Gist options
  • Save mkjsix/7adce1aefb93c5be403c7ae6f487281b to your computer and use it in GitHub Desktop.
Save mkjsix/7adce1aefb93c5be403c7ae6f487281b to your computer and use it in GitHub Desktop.
Apply a git command recursively in all folders
#!/bin/bash
find . -type d -name .git -exec sh -c "cd \"{}\"/../ && pwd && git $1" \;
@mkjsix
Copy link
Author

mkjsix commented Apr 26, 2017

Example usage: $ ./git-all.sh "pull --rebase"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment