我想在GitLab服务器端查看存储库在上个月中有多少更改。
cd /path/to/my/bare/repo.git/
git --git-dir . diff --shortstat "@{1 month ago}"
fatal: Unable to read log 'logs/refs/heads/master': No such file or directory
然而,在本地检出的工作分支中它可以正常工作。
有没有一种不需要太多麻烦的方法来解决这个问题?
为了避免 X-Y 问题:我想在 Gitlab 服务器上的数百个存储库上运行统计信息。
--git-dir
吗? - NoDataFoundcd /path/to/bare/repo.git ; git diff --shortstat '@{1 month ago}'
应该可以工作。 - knittlgit --git-dir /path/to/my/bare/repo.git/ branch -a
表示什么? - marbu* master
。 - λq_This operation must be run in a work tree
。我不会说这是不可能的(gitk在裸仓库上显示差异,但我猜它使用提交的SHA1来创建差异!)。 - NoDataFoundstrace git log
,它确实在扫描大量的SHA1,但是git diff
需要logs/refs/heads/master
。 - λq_