How does git handle folder permission?

后端 未结 1 1423
清歌不尽
清歌不尽 2020-11-30 06:42

I\'m using git version 1.5.6.3, and it seems git doesn\'t notice a folder\'s mode changes

#create a test repository with a folder with 777 mode
:~$ mkdir -p          


        
相关标签:
1条回答
  • 2020-11-30 06:49

    The only 'permissions' bit that git tracks is the executable bit for files, the rest of the mode bits describe what type of file system object the object in each git tree is. git supports files and symlinks (blobs), directories (trees) and the submodules (commits).

    git is designed to help track source code across different machines. Permission bits depend on user and group mappings between machines. In distributed environments where these mappings don't exist, tracking permission bits usually ends up hindering things rather than helping anything.

    If you need to track more file system attributes that what git tracks natively you could consider and extension tool such as etckeeper.

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