Is there a way to execute git-grep command on a remote repository tree?

1.1k Views Asked by At

I would like to search the contents of files located in one of subtrees of the remote repository (origin/master). git-grep documentation says that command works on a current working tree. Consequently, how can I search through files that make up remote repo tree?

1

There are 1 best solutions below

0
On BEST ANSWER

There is no way in git. Either you fetch the remote commits locally or use out-of-git access to the remote repository. With ssh you just do ssh remote-host "cd /repo && git grep". With web access use whatever search is provided.