Home > Backend Development > PHP Tutorial > After using git to get the code, the owner and group have changed. Is there any solution?

After using git to get the code, the owner and group have changed. Is there any solution?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-08-04 09:20:34
Original
1268 people have browsed it

Now I use the root account to update the code. Before, the owner and group of the kernel.php file were www. Now after the update, it becomes root. Is there any way not to change it?
As shown:
After using git to get the code, the owner and group have changed. Is there any solution?

Reply content:

Now I use the root account to update the code. Before, the owner and group of the kernel.php file were www. Now after the update, it becomes root. Is there any way not to change it?
As shown:
After using git to get the code, the owner and group have changed. Is there any solution?

The easiest way is to switch to the www user and then pull the code, or use chown -R www:www . to re-update the owner after pulling the code.

Just use the aliasalias that comes with Linux to map it.

<code class="bash">alias wwwgit='su - www -c git' </code>
Copy after login

Then use wwwgit instead of git in future commands.


This is an idea, not tested

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
ssh - git clone and git push errors
From 1970-01-01 08:00:00
0
0
0
git push cannot be submitted
From 1970-01-01 08:00:00
0
0
0
git checkout specific version failed
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template