Can Mercurial be made to preserve file permissions?

前端 未结 5 1875
星月不相逢
星月不相逢 2021-01-30 10:19

I\'ve seen a number of blog posts, and have experienced for myself, that Mercurial does not preserve the permissions on files pushed from one repo to another. Does anyone know

5条回答
  •  猫巷女王i
    2021-01-30 11:24

    What about using this solution from the Mercurial FAQ:

    If you're using Mercurial for config file management, you might want to track file properties (ownership and permissions) too. Mercurial only tracks the executable bit of each file.

    Here is an example of how to save the properties along with the files (works on Linux if you've the acl package installed):

    # cd /etc && getfacl -R . >/tmp/acl.$$ && mv /tmp/acl.$$ .acl
    # hg commit
    

    This is far from perfect, but you get the idea. For a more sophisticated solution, check out etckeeper.

提交回复
热议问题