Git pull in a Linux environment changes the owner of the filesPermissions issue with gitexplanation on...
How to calculate a conditional PDF in mathematica?
Is it bad to suddenly introduce another element to your fantasy world a good ways into the story?
What does the ash content of broken wheat really mean?
How many spells does my Bard 6/Wizard 1 know?
Was Wolfgang Unzicker the last Amateur GM?
How frequently do Russian people still refer to others by their patronymic (отчество)?
Why did moving the mouse cursor cause Windows 95 to run more quickly?
Why would a propeller have blades of different lengths?
Should I increase my 401k contributions, or increase my mortgage payments
Should I warn my boss I might take sick leave
What units are kpts?
Boss has banned cycling to work because he thinks it's unsafe
How can solar sailed ships be protected from space debris?
What happens if the limit of 4 billion files was exceeded in an ext4 partition?
What is the maximum amount of diamond in one Minecraft game?
CPA filed late returns, stating I would get money; IRS says they were filed too late
Is it possible to spoof an IP address to an exact number?
Will electrically joined dipoles of different lengths, at right angles, behave as a multiband antenna?
How to improve the size of cells in this table?
How might boat designs change in order to allow them to be pulled by dragons?
Interview Question - Card betting
Did Snape really give Umbridge a fake Veritaserum potion that Harry later pretended to drink?
What is exact meaning of “ich wäre gern”?
Minimizing medical costs with HSA
Git pull in a Linux environment changes the owner of the files
Permissions issue with gitexplanation on chown(1) POSIX specEditing Remote Files in Git repoWhy does git store my SSH identity in gnome, but not KDE?Chown for every created file in folderAfter git, folders and files goneGit Bash for both Ubuntu/Linux and Windows requires ssh-agent on restartHow to change the owner and group of a directory by the name of that directory?Git and Git LFS: Doing version tracking on files via a servergit: URL format to access remotely local git server
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
Why will every time I execute a git pull on my live server, the owner of the files be changed? I keep on manually doing a chown john:john index.php.
What do I need to change so that, when I do a git pull, the owner of the files will be automatically be or stay john?
git chown
add a comment |
Why will every time I execute a git pull on my live server, the owner of the files be changed? I keep on manually doing a chown john:john index.php.
What do I need to change so that, when I do a git pull, the owner of the files will be automatically be or stay john?
git chown
1
Isjohnthe owner of the current directory?
– user000001
Sep 10 '14 at 17:02
Yes, john is the owner of the directory :)
– PinoyStackOverflower
Sep 10 '14 at 17:09
1
Which user runninggit pull?
– cuonglm
Sep 10 '14 at 18:03
@Gnouc root user, I am logged in in our live server via SSH as root user :)
– PinoyStackOverflower
Sep 11 '14 at 0:40
add a comment |
Why will every time I execute a git pull on my live server, the owner of the files be changed? I keep on manually doing a chown john:john index.php.
What do I need to change so that, when I do a git pull, the owner of the files will be automatically be or stay john?
git chown
Why will every time I execute a git pull on my live server, the owner of the files be changed? I keep on manually doing a chown john:john index.php.
What do I need to change so that, when I do a git pull, the owner of the files will be automatically be or stay john?
git chown
git chown
edited Mar 11 '18 at 22:21
Jeff Schaller♦
47.4k11 gold badges69 silver badges154 bronze badges
47.4k11 gold badges69 silver badges154 bronze badges
asked Sep 10 '14 at 16:59
PinoyStackOverflowerPinoyStackOverflower
1731 gold badge1 silver badge7 bronze badges
1731 gold badge1 silver badge7 bronze badges
1
Isjohnthe owner of the current directory?
– user000001
Sep 10 '14 at 17:02
Yes, john is the owner of the directory :)
– PinoyStackOverflower
Sep 10 '14 at 17:09
1
Which user runninggit pull?
– cuonglm
Sep 10 '14 at 18:03
@Gnouc root user, I am logged in in our live server via SSH as root user :)
– PinoyStackOverflower
Sep 11 '14 at 0:40
add a comment |
1
Isjohnthe owner of the current directory?
– user000001
Sep 10 '14 at 17:02
Yes, john is the owner of the directory :)
– PinoyStackOverflower
Sep 10 '14 at 17:09
1
Which user runninggit pull?
– cuonglm
Sep 10 '14 at 18:03
@Gnouc root user, I am logged in in our live server via SSH as root user :)
– PinoyStackOverflower
Sep 11 '14 at 0:40
1
1
Is
john the owner of the current directory?– user000001
Sep 10 '14 at 17:02
Is
john the owner of the current directory?– user000001
Sep 10 '14 at 17:02
Yes, john is the owner of the directory :)
– PinoyStackOverflower
Sep 10 '14 at 17:09
Yes, john is the owner of the directory :)
– PinoyStackOverflower
Sep 10 '14 at 17:09
1
1
Which user running
git pull?– cuonglm
Sep 10 '14 at 18:03
Which user running
git pull?– cuonglm
Sep 10 '14 at 18:03
@Gnouc root user, I am logged in in our live server via SSH as root user :)
– PinoyStackOverflower
Sep 11 '14 at 0:40
@Gnouc root user, I am logged in in our live server via SSH as root user :)
– PinoyStackOverflower
Sep 11 '14 at 0:40
add a comment |
1 Answer
1
active
oldest
votes
When you use git pull (which is equivalent to git fetch; git merge), git will update files without changing owner (git does not store that information). But if there is new files to create, the current user will be set as the owner.
There is different solution to solve this. The easier is probably to add a post-update hooks (in your .git/hooks directory) to automatically call chown john:john . -R after merge/pull (see that SO solution for an example).
Alternate solutions are:
- Run
git pullas the john user instead of root (that will require write permissions to john for .git directory). - Create a hook to make the deployment, which will either use john as user, either do the chown after update (so you will have to do
git pullinside thepost-receivehook of the bare repo).
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f154859%2fgit-pull-in-a-linux-environment-changes-the-owner-of-the-files%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
When you use git pull (which is equivalent to git fetch; git merge), git will update files without changing owner (git does not store that information). But if there is new files to create, the current user will be set as the owner.
There is different solution to solve this. The easier is probably to add a post-update hooks (in your .git/hooks directory) to automatically call chown john:john . -R after merge/pull (see that SO solution for an example).
Alternate solutions are:
- Run
git pullas the john user instead of root (that will require write permissions to john for .git directory). - Create a hook to make the deployment, which will either use john as user, either do the chown after update (so you will have to do
git pullinside thepost-receivehook of the bare repo).
add a comment |
When you use git pull (which is equivalent to git fetch; git merge), git will update files without changing owner (git does not store that information). But if there is new files to create, the current user will be set as the owner.
There is different solution to solve this. The easier is probably to add a post-update hooks (in your .git/hooks directory) to automatically call chown john:john . -R after merge/pull (see that SO solution for an example).
Alternate solutions are:
- Run
git pullas the john user instead of root (that will require write permissions to john for .git directory). - Create a hook to make the deployment, which will either use john as user, either do the chown after update (so you will have to do
git pullinside thepost-receivehook of the bare repo).
add a comment |
When you use git pull (which is equivalent to git fetch; git merge), git will update files without changing owner (git does not store that information). But if there is new files to create, the current user will be set as the owner.
There is different solution to solve this. The easier is probably to add a post-update hooks (in your .git/hooks directory) to automatically call chown john:john . -R after merge/pull (see that SO solution for an example).
Alternate solutions are:
- Run
git pullas the john user instead of root (that will require write permissions to john for .git directory). - Create a hook to make the deployment, which will either use john as user, either do the chown after update (so you will have to do
git pullinside thepost-receivehook of the bare repo).
When you use git pull (which is equivalent to git fetch; git merge), git will update files without changing owner (git does not store that information). But if there is new files to create, the current user will be set as the owner.
There is different solution to solve this. The easier is probably to add a post-update hooks (in your .git/hooks directory) to automatically call chown john:john . -R after merge/pull (see that SO solution for an example).
Alternate solutions are:
- Run
git pullas the john user instead of root (that will require write permissions to john for .git directory). - Create a hook to make the deployment, which will either use john as user, either do the chown after update (so you will have to do
git pullinside thepost-receivehook of the bare repo).
edited 31 mins ago
Eliah Kagan
3,2922 gold badges16 silver badges33 bronze badges
3,2922 gold badges16 silver badges33 bronze badges
answered Jan 9 '15 at 9:22
AsenarAsenar
2312 silver badges6 bronze badges
2312 silver badges6 bronze badges
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f154859%2fgit-pull-in-a-linux-environment-changes-the-owner-of-the-files%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Is
johnthe owner of the current directory?– user000001
Sep 10 '14 at 17:02
Yes, john is the owner of the directory :)
– PinoyStackOverflower
Sep 10 '14 at 17:09
1
Which user running
git pull?– cuonglm
Sep 10 '14 at 18:03
@Gnouc root user, I am logged in in our live server via SSH as root user :)
– PinoyStackOverflower
Sep 11 '14 at 0:40