Search code examples
gitrepositorygit-remote

How to find local git repositories without remote origin?


Local git repositories often start out without a remote repository. How can one find all those repos which haven't been pushed yet (=have no remote origin attached to them)?

Recursive folder searches are slow.


Solution

  • I've found a fast solution via ripgrep:

    rg --files-without-match --hidden --glob '**/.git/config' remote
    

    searches recursively for all .git/config files not containing remote (tested on win10).