野声

Hey, 野声!

谁有天大力气可以拎着自己飞呀
twitter
github

About the things that happened after executing sudo git out of curiosity

When using sudo git add command in Ubuntu, it caused the repository to be inaccessible without the sudo prefix each time. This is because after using sudo, the regular user group loses the permission to operate. I found a solution on stackoverflow.

First, we need to know the id of our user and user group. Enter the following command in the terminal:

id -a

It will display the id of the user and group:

Snipaste_2018-01-25_14-48-31.png

Next, we need to use the chown command:

cd .git/objects
ls -al
sudo chown -R uid:groups *
# Replace uid and groups with your own
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.