3

How does one verify that files were pushed to a bare repository correctly? Since bare repositories have no working tree, you obviously can't do a simple git log because it isn't picked up as a git repo.

I realize there are solutions like suggested here, but I'd like to know how to do it using the command line.

Community
  • 1
  • 1
Qix - MONICA WAS MISTREATED
  • 14,451
  • 16
  • 82
  • 145

2 Answers2

3

git log works just fine. Bare repositories are still recognized as repositories. Obviously. :)

git@koiru /var/git/repositories/sanpera.git $ ls
total 37k
-rw-r--r--   1 git nogroup 1.2k Mar  1 06:00 FETCH_HEAD
-rw-r--r--   1 git nogroup   23 Sep 14  2011 HEAD
drwxr-xr-x   2 git nogroup 4.1k Sep 14  2011 branches/
-rw-------   1 git nogroup  236 Jun 12  2012 config
-rw-r--r--   1 git nogroup   34 Jun 12  2012 description
drwxr-xr-x   2 git nogroup 4.1k Jun 12  2012 hooks/
drwxr-xr-x   2 git nogroup 4.1k Sep 14  2011 info/
drwxr-xr-x 222 git nogroup 4.1k Sep  9 06:00 objects/
drwxr-xr-x   5 git nogroup 4.1k Oct 18  2011 refs/

git@koiru /var/git/repositories/sanpera.git $ git log
commit a60f2ad3cc118eb7fd290be56448bcef82fe8252
Author: Eevee <git@veekun.com>
Date:   Sun Sep 2 18:22:50 2012 -0700

    Stub a few more tests.

...
Eevee
  • 47,412
  • 11
  • 95
  • 127
3

You could try and use git ls-remote:

 git ls-remote http://www.kernel.org/pub/scm/git/git.git

 # or, also a bare repo
 git ls-remote https://github.com/git/git

As long as it doesn't return just the emtpy tree SHA1, that should mean there are commits in that upstream repo.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250