You can call magit-statususing prefix-arg ( C-u), it will prompt you to create a git repository. So, if you bind keybinding for magit-status C-x g, you can do it C-u C-x g, it will suggest git repo.
You can also set the variable magit-repo-dirsto a directory (do C-h f magit-repo-dirs RETto find out more) and it will offer you all git's repositories magit-repo-dirs.
If you use a projectile, you can use the fact that it remembers your project directories and uses it to fill magit-repo-dirs, I have this in my initialization file to achieve this
(eval-after-load "projectile"
'(progn (setq magit-repo-dirs (mapcar (lambda (dir)
(substring dir 0 -1))
(remove-if-not (lambda (project)
(file-directory-p (concat project "/.git/")))
(projectile-relevant-known-projects))))
(setq magit-repo-dirs-depth 1)))
The above code is executed after loading projectile. He gets a list of projects known projectile, performing (projectile-relevant-known-projects), iterates through them and adds projects in which .git/folder on magit-repo-dirs, and sets magit-repo-dirs-depthto 1 so magit looking git repos only the top directories.
user2053036
source
share