I have a folder where I keep all of my Git repos. I usually just do git pull
to get my changes, but now that I have over 50 repos it becomes a burden to have to do this for every folder.
How can I run a command that will loop through every repo and update it for me?
In Bash you can run this command which will loop through every repo in your working directory, stash your changes, fetch the origin and pull the latest commit.
for d in */; do cd $d; git stash; (git pull &); cd ..; done
Some things to note:
(git pull &)
opens a subshell and executes in the backgroundIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With