2

Possible Duplicate:
How can I check whether a git repository has any commits in it?

Which is the best way to determine if repository is empty, like after it is just created?

Community
  • 1
  • 1
tig
  • 25,841
  • 10
  • 64
  • 96

1 Answers1

4

One quick way would be to look for files in the .git/objects directory. If there are none present then you know it must be brand new.

$> find .git/objects -type f | wc -l # if this prints 0, then it's brand spankin' new.
Chris Eberle
  • 47,994
  • 12
  • 82
  • 119