如何验证文件是否正确地推送到裸仓库?由于裸仓库没有工作树,所以显然不能像普通的git repo一样简单地使用“git log”进行操作。
我知道有一些解决方案,比如这里建议的方法,但我想知道如何通过命令行来完成。
我知道有一些解决方案,比如这里建议的方法,但我想知道如何通过命令行来完成。
你可以尝试使用 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
ssh://
协议的 URL。 - Qix - MONICA WAS MISTREATEDgit log
命令可以正常使用。裸仓库仍然被视为仓库。显然。:)
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.
...
HEAD
听起来像是你没有任何数据的很好的指示。检查refs/heads
目录;那里列出了所有的分支。如果它是空的,你什么也没有。 - Eevee