Are file permissions and owner permissions allowed: group properties included in git?

Are file and owner permissions allowed: group properties included in git? How are these file and directory properties handled in the git pipeline [commit, push, pull, merge, etc.]?

+6
source share
3 answers

Files in Git are assigned either 644 (owner rw- , group and other r-- ), or 755 (owner rwx , group and other rx ). Information about the owner is not saved.

This is deliberately and well explained by this post by a Git assistant, Junio ​​Hamano:

In fact, in the very early days, Git is used to record the full (mode and 0777) for drops.

As soon as people started using git, everyone realized that it had a very unpleasant side effect, that the resulting tree depended on user umasks, because one person writes blob with 664 mode and the next person who modifies the file writes with 644 mode, and he It’s very difficult to track significant source code changes. This problem was fixed a long time ago with commit e447947 (be much more liberal regarding the mode bit file., 2005-04-16).

+7
source

Generally not. This is all that is local to a particular machine environment.

The exception is that Git uses parameters similar to resolution to track several “universal” attributes, for example, whether the executable is a file and if the object is a file or a submodule. Git can, whenever possible, map them to your local environment when placing an order.

+3
source

On Windows, no, but * nix will cause changes in permissions. I had problems when Windows sees changes in * nix permissions and is not quite sure what to do with it.

0
source

Source: https://habr.com/ru/post/985687/


All Articles