GIT: Any way to commit multiple repositories?

I know that this is not recommended, but I have folders with several projects that I like in the current state.

Is there a command that will search for every git repository in the folder and send the following commands.

git add -u git add . git commit -m 'Latest' 

So, I could just write cd to some folder, and then run a command that will update them all.

This is not a question of submodules.

+8
git
source share
3 answers

why don't you use something like this:

 #!/bin/bash for DIR in `ls`; do if [ -d $DIR/.git ]; then echo "updating location: " $DIR; cd $DIR # your commands here... git add -u git add . git commit -m 'Latest' cd .. fi done 
+5
source share

Perhaps you are looking for something like mr ( home page ). I use it to update a bunch of repositories right away, but it can be customized to whatever material you need. It is also available as an Ubuntu and Debian package in official repositories. Otherwise, you can simply write a script that will do this for you.

+2
source share

Disclamer: This is native code. I have no financial gain if you use or fork it, but it is written for such a scenario and may help;)

I wrote gitglue. You can tag repositories and execute arbitrary tag-based commands. Check out this tutorial about gitglue or fork gitglue on Github.

+2
source share

All Articles