0

I am new to git and somewhat frustrated with the lack of functions I am used to from other VCSs. One such feature is to be able to see the directory structure of the remote without having it cloned locally. Imagine that you wanted to see if a certain path existed on the remote but did not have any space locally to have it cloned. To me this seems like a very basic function and can't see why it wouldn't be readily available in both command line plain git as well as EGit in Eclipse. Are they excluded just to add another shroud of mysterious difference from others VCSs?

ThiefMaster
  • 310,957
  • 84
  • 592
  • 636
amphibient
  • 29,770
  • 54
  • 146
  • 240
  • 5
    "Are they excluded just to add another shroud of mysterious difference from others VCSs?" - you do realise whining will just make people argue with the whining instead of seeing the crux of the question? It's better to stay on point. – millimoose Sep 03 '13 at 14:48
  • Why would you not want to clone locally anyway? Clone it to `/tmp` and ditch it if you don't like it. – tripleee Sep 03 '13 at 14:51
  • You can always do a shallow clone (`--depth 1`) as well to save space. (Disregarding that "I do not have any space locally" makes little sense with today's hard drive costs.) – millimoose Sep 03 '13 at 14:51
  • it was a hypothetical scenario. i just wanted a preview – amphibient Sep 03 '13 at 14:54
  • @amphibient Don't use contrived hypotheticals, ask about problems you're *actually facing*. Unless you're **really** out of disk space, a clone will give you the preview you want, and if you bothered to read the man page for the command, you'd have found out about shallow clones, instead of getting stuck on the notion that this requires dedicated functionality. – millimoose Sep 03 '13 at 14:55
  • "preview" is concrete enough. say that a clone takes 10 min and you don't want to do it just to check a path – amphibient Sep 03 '13 at 14:57
  • @amphibient `git clone --depth 1 https://github.com/rails/rails.git` takes 90 seconds for 150MB. Keeping it up-to-date afterwards would probably be instantaneous. (Arguably "read-only clones" is the one thing shallow cloning is good for.) Your clone is not taking 10 minutes, and the initial clone is a cost Git expects you to accept. – millimoose Sep 03 '13 at 15:00
  • In fact I'm guessing the main reason Git doesn't do this is that: a) The architecture of the remote protocols doesn't readily support this (I'm assuming it's designed to move around blobs representing Git's internal data structures as efficiently as possible.) And b) nobody demonstrated enough of a need for this feature to devote development time to it, compared to what a regularly updated clone does. – millimoose Sep 03 '13 at 15:13
  • @millimoose ... and (c) It's sort of counter to the whole philosophy of a DVCS - as far as I know, other DVCSs (e.g. `mercurial`) have this same "limitation" (but I'm hardly well-versed in DVCSs other than `git`, so I might be wrong about that). – twalberg Sep 03 '13 at 15:38

1 Answers1

1

There is no way to preview repository without cloning. Git is DVCS, where D stands for distributed. So looking up non-local repo is against git ideology.

Online wrappers like Github or Bitbucket as well as some scripts using corresponding APIs can probably accomplish what you want though.

Ruslan Osipov
  • 5,655
  • 4
  • 29
  • 44