12

If I want to look inside a file in a remote repository, is this possible without cloning the whole repository?

I tried

git ls-remote git@remoteserver.com:repo.git

but that only displays references available in a remote repository along with the associated commit IDs.

There is a solution on the console here but that is quite complicated and not very handy to use on multiple files. You can see the content in some certain file (for ex. ìndex.php) this way.

Optimal for me would be a sort of file-browser (like Krusader) on Linux, where I would just enter the git url git@remoteserver.com:repo.git and can browse all files inside the repository.

1

Option 1

Use something as gitweb in the pc that have the original repository.

Option 2

If you can't do that, you can make a shallow clone with depth=1 that should be as fast as downloading an snapshot.

Option 3

If you don't want that it will depend on the actual protocol you are using to get the repo, usually it is ssh or http, so you can mount a virtual file-system pointing there with the right credentials.

Alternative

May be you should be looking for a service like github that will help browsing repos without download.

  • 1
    Option 1 might be understood as "install github webapp in the pc that have the original repository", which is impossible. A clarification would be welcome. – Nicolas Raoul Apr 4 '14 at 2:17
  • 1
    Option 3 is a good idea, a bit of details could be useful. The repo is git@remoteserver.com:repo.git so the protocol is SSH. – Nicolas Raoul Apr 4 '14 at 2:21
  • That's why I say that gitweb can be used instead of github. – eloyesp Apr 4 '14 at 2:22
  • 1
    @NicolasRaoul I moved github as an alternative approach. – eloyesp Apr 4 '14 at 2:35

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.