git diff on a bare repo

前端 未结 2 663
栀梦
栀梦 2021-02-10 04:27

I wanna see how much a repo changed in the last month on gitlab server side

cd /path/to/my/bare/repo.git/
git --git-dir . diff --shortstat \"@{1 month ago}\"
fa         


        
2条回答
  •  无人共我
    2021-02-10 04:31

    I found this question because I was getting fatal: This operation must be run in a work tree

    If you are getting the error (in your bare repo):

    [ec2-user@xxxxx git]$ git diff 81dcb182e4d16b6894b69a5b31133b8d8ff6c5e2
    fatal: This operation must be run in a work tree
    

    Ensure you are providing two commit hashes to diff.(as HEAD is a symbolic ref)

    [ec2-user@xxxxx git]$ git diff  
    

    Eg.

    [ec2-user@xxxxx git]$ git diff 11dcb182e4d16b6894b69a5b31133b8d8ff6c5ex 81dcb182e4d16b6894b69a5b31133b8d8ff6c5e2
    

提交回复
热议问题