Home >Backend Development >PHP Tutorial >After using git to get the code, the owner and group have changed. Is there any solution?
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:
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:
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 alias
alias that comes with Linux to map it.
<code class="bash">alias wwwgit='su - www -c git' </code>
Then use wwwgit
instead of git in future commands.
This is an idea, not tested