I need to track a folder (I’ll name it “root”) that contains empty folders.
So I created an empty .gitignore for each empty folder, I added them but now I’d like to track its permissions (chmod 777 root -R).
But nothing doesn’t change on git status
I need to track a folder (I’ll name it root) that contains empty folders.
Share
Git does not track permissions. It only tracks executability. For the matter, no other common version control tool tracks permissions either. So you need something built on top of those tools to track permissions. E.g. etckeeper.
This works by adding hooks in the repository that:
You could even put up something simple single-purpose yourself; it’s rather simple (that’s what holygeek talks about below).
Note, that the hooks run in the work tree. Other repositories that just store the data don’t need anything and you can even check out the data elsewhere without the tool. The files will not have the defined permissions there though.