A
A
AlexxZhuravlev72018-02-19 15:25:39
linux
AlexxZhuravlev7, 2018-02-19 15:25:39

How to make GIT stop overwriting group owner?

The bottom line is this - when I do a git pull, I overwrite the group for a file,
for example, I have a file before git pull
-rw-r----- 1 user groupname footer.tpl
after git pull
-rw-r---- - 1 user user footer.tpl
how do I avoid overwriting the group?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
Saboteur, 2018-02-19
@saboteur_kiev

Run git as a user whose primary group is groupname.
Well, either manually then perform chmod.
There is no other way - when creating a file (and git creates files), it is created on behalf of the ID and GID of the current user / process.

K
ky0, 2018-02-19
@ky0

usermod -g groupname user

A
aol-nnov, 2018-02-19
@aol-nnov

Read help on umask and execute umask <mask>.
After already your git commands.

L
Lynn "Coffee Man", 2018-02-19
@Lynn

Put on setgid bit
https://www.gnu.org/software/coreutils/manual/html...

On most systems, if a directory's set-group-ID bit is set, newly created subfiles inherit the same group as the directory, and newly created subdirectories inherit the set-group-ID bit of the parent directory.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question