14

I'm maintaining several git repositories using magit, and their numbers keep growing. Is there a way to inform magit of all these projects so that a single command would present a summary of the status of each one instead of manually running magit-status on each one of them ?

17

Is there a way to inform magit of the list of all these projects...

Yes, see magit-repository-directories and magit-repository-directories-depth.

...so that a single command would present a summary of the status of each one

At the time this question was asked such a command did not exist, but now it does. Try M-x magit-list-repositories and see the documentation : (https://magit.vc/manual/magit/Repository-List.html).


You can also list all submodules of a super-repository in a similar fashion using M-x magit-list-submodules. Or you can show some of that information directly in the status buffer using:

(magit-add-section-hook 'magit-status-sections-hook
                        'magit-insert-modules
                        'magit-insert-unpulled-from-pushremote)

Then all the modules are listed in a separate section. Modules with changes are listed as usual in Staged changes and Unstaged changes. RET on any of these modules shows the status buffer for that repository and q takes you back to the status buffer of the super-repository.

Submodules can be fetched using f m.

  • Thanks, the submodules seem the way to go. Should I clone my various git repos in this new super-project (and go through some tedious configuration for each one) or can I just move the directories in a common one and then declare each as a submodule? – wilk Dec 30 '15 at 23:17
  • You could mv the repositories, but then you would still have to git submodule add git://<module> <module> each one of them, but that at least is better than having to setup all the remotes and branches again. – tarsius Dec 30 '15 at 23:21
  • It seems to be <kbd>f m<kbd> instead of <kbd>F m<kbd> to fech submodules. – wilk Feb 10 '16 at 9:48
2

Having felt a similar need for managing multiple git repositories simultaneously, I've tried to come up with a solution: https://github.com/luismbo/multi-magit.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.