Show the permission of a indexed file in git

前端 未结 2 1626
挽巷
挽巷 2021-01-04 05:43

This is related to another question I recently asked about storing a non-bare repository in Dropbox for easy movement between computers, so it may be helpful to read that qu

相关标签:
2条回答
  • 2021-01-04 06:23

    To see what git actually thinks about your files in commits and the index, use git ls-tree <tree> and git ls-files -s <path> respectively.

    By the way, it seems that git only looks at the executable bit, and assumes 644 for everything else. Look at create_ce_mode in cache.h if you want to try debugging this weird issue.

    0 讨论(0)
  • 2021-01-04 06:35

    Use gitk as follows

    $ gitk path/to/repository/file
    

    In the opened window, under dashed line you can see six digits. The last three are the file permissions.

    ...
    ------------------------------- path/to/repository/file -------------------------
    index a5e14048..08ce8948 100644
    ...
    

    In the example above 6 digits are 100644 and file permission is 644

    0 讨论(0)
提交回复
热议问题