Thursday, October 2, 2014

git pull all your .gits

I'll provide this commandline with the terms that I am not responsible for any screw-ups due to it. (caveat: if your local repo specifies to merge, it will attempt merge or maybe warn.)


Find all your .gits and git pull each project:
find ~/ -type d -name ".git" -exec git -C '{}/..' pull \;

If you prefer to actually see which are updating, try:
find ~/ -type d -name ".git" -exec echo "{}" \; -exec git -C '{}/..' pull \; -exec echo "" \;

good luck!
---

1 comment:

  1. originally posted as
    find ~/ -name ".git" -exec git -C '{}' --work-tree '{}' pull \;
    but prefer the edited version

    ReplyDelete

Comments, Suggestions or "Thank you's" Invited!