Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show the permission of a indexed file in git

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 question for background.

The gist is that the fileMode keeps reporting a diff for some number of files. I can't find a way to reproduce it consistently, but it happens frequently. What I've noticed is that the file, which has 644 permissions on both machines often reports a diff from 755 on one of the machines. This makes me think that Git believes the executable bit is set, but I can't figure out whether I can actually see how Git has that bit set.

like image 760
Rob Wilkerson Avatar asked Sep 29 '10 11:09

Rob Wilkerson


1 Answers

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.

like image 102
Josh Lee Avatar answered Sep 26 '22 07:09

Josh Lee