git repository browsing

I am interested if I can do repository browsing with git in the following way:

given a remote repository
-fetch only data about the directory structure of a certain revision at the beginning
– fetch files individually on choice given the knowledge acquired previously

  • Viewing html in Gitweb
  • Is it possible to create a file somewhere in github via browser?
  • Calling an svn update from a php script via a browser is not working
  • git log Graph seems differences in GitHub and Console
  • Could Not Resolve Host
  • for example(fake commands only to illustrate intent):

    git clone –dont_get_me_repo_contents_please
    // the info about the file contents is somewhere and i see my/cool/file alongside with others
    git get my/cool/file

    Supposedly I would not be owning that server (the one were the remote repo is stored). I can only interact with it through the git client.

    I just want to use as little network transfer as possible and as little space.

    Basically, what you do on github, when you look through the files of a revision, and you see the dirs, you click on a file and you get just those contents. The only info that gets sent over the network is the dir structure and the contents of the file you are looking at.
    I’m assuming it is interacting with the git repo on the server. now how does it do that?

    I do not want something that does this, maybe just as an example,I want to know how this is done.

    I’ve done some reading and I feel the answer is no, this cannot be done in this form.
    Is it the case that one cannot do this and one needs a checked out revision somewhere? If so, what are my best alternatives, given my objectives (use as little network traffic as possible, secondary – try to minimize space as well).

    I’m sorry if my use of git terms is abusive (n00b here). I hope I got the idea across.

    EDIT: What about MERCURIAL? can these things be done with it?


  • Cloning a Git repo without the .git directory
  • Focus HEAD initially in git log
  • Git: Find which commit is checked out on a remote
  • How can I push changes directly from Cloud9 IDE to Heroku?
  • Show trailing whitespace and line endings in removed lines in diff output
  • How to make eclipse neon show git branch in package view?
  • One Solution collect form web for “git repository browsing”

    You could start with a shallow git clone (say, only 1 revision in the history):

    git clone --depth 1
    Git Baby is a git and github fan, let's start git clone.