1

I'm trying to write a tool that inspects some git repositories.

I wondered what information is stored in a bare repository that regards submodules?

So far I assume that it's only the .gitmodules file. Would be nice if anyone could confirm this.

NoDataDumpNoContribution
  • 10,591
  • 9
  • 64
  • 104
Onur
  • 5,017
  • 5
  • 38
  • 54

1 Answers1

2

Correct, .gitmodules is a file within the repository, you can't directly access it within a bare repo, but you can obtain it with git show HEAD:.gitmodules.

NoDataDumpNoContribution
  • 10,591
  • 9
  • 64
  • 104
Oliver Matthews
  • 7,497
  • 3
  • 33
  • 36
  • 1
    I think I could if I browse the objects of tree type and look for an entry of type blob named `.gitmodules`, but that's not what I want anyway. – Onur Mar 18 '14 at 15:46
  • I wouldn't really have called that direct. Plus you'd need to parse the tree to figure out *which* blob you wanted (assuming it had ever been changed). – Oliver Matthews Mar 18 '14 at 15:58
  • I'd start with the tree of the HEAD. But that's just a theoretical exercise since I don't want to do that anyway. – Onur Mar 18 '14 at 16:00