I wanted to figure out why, after a etckeeper commit, I had a problem with rebooting (already solved thanks to this great thing).
I played with etckeeper, did git checkout some_commit_sha
for a quick look and then git checkout master
.
And it seems my file permissions in /etc
were broken after those manipulations. All files including ssh_host_rsa_key passwd-, shadow-
were rw-r--r--
. I didn't know Git does not save file permissions.
Now I fixed all of them (I hope I didn't miss anything).
What was the right way to get earlier states of /etc
, look around, and go back to the master with the right file permissions?
According to the documentation (see below) you have to run
after checking any files back out in order to restore permissions. git can't store file permissions directly so it's handled by etckeeper and you need to run the init again to restore them after a checkout.
Documentation section,