2

I have been given a git link to clone which is taking forever (even with --depth 1). I'd like to have a mechanism whereby I can inspect all the files of the master branch without cloning. Is this possible?

git ls-remote doesn't produce what I need:

git ls-remote git@myproject.git
0b6b5758e91074c3598578de54fadbc6493f64b1    HEAD
0b6b5758e91074c3598578de54fadbc6493f64b1    refs/heads/master

Updated: Based on this rather old question that I just discovered (dated 2009, but latest answer update in 2016), it seems it is impossible, unless you have general ssh access to the instance to do an ls, which I don't. I'm guessing that is still the current status as of 2018?

Liam
  • 27,717
  • 28
  • 128
  • 190
user1361529
  • 2,667
  • 29
  • 61
  • Yes, ASFAIK, that is still impossible. – j6t Jun 27 '18 at 13:26
  • 1
    I don't know of such a functionality ... I'm afraid you will have to clone it. – YesThatIsMyName Jun 27 '18 at 13:28
  • argh, I feared this to be the case.Thank you. I don't understand why this is a big deal with git though. The remote is always at one place - I understand local/working copy commits are distributed, but "remote master" should be easy to list - just like we browse "GitHub" repos. Or am I missing something? – user1361529 Jun 27 '18 at 13:36
  • GIT repos are exact copies of each other, remote or local, there is no difference. You always work on your downloaded copy, get it up to date then push it. That's by design. Nothing has changed since that question was written. Nor is it likely to any time soon this is fundamental to how GIT works. – Liam Jun 27 '18 at 15:31
  • @Liam I don’t see how repos being exact copies should result in issues if trying to list the contents of a remote repo. Just like github allows you to. I still don’t see why this is a functional limitation of git. I get that no such command exists and in git you are meant to work on your local copy. I don’t get why simply trying to list contents of a remote is hard to implement. – user1361529 Jun 30 '18 at 16:57
  • Because that's what [Linus](https://en.wikipedia.org/wiki/Linus_Torvalds) wanted – Liam Jul 09 '18 at 07:53

0 Answers0