visual-studio-code - Why does every time I execute a git command on the Ubuntu system, if I do not add sudo, it will prompt that the permissions are insufficient and the operation cannot be performed?
世界只因有你
世界只因有你 2017-05-02 09:49:11
0
3
856

For example, if I create a git warehouse in any folder such as /opt/html, enter the git init command, and press Enter, it will prompt /opt/html/.git: Insufficient permissions. Just add sudo and it will be fine. I don’t think so. Can I just give him permission when adding sudo? This will be troublesome every time I sudo. Moreover, I now use visual studio code for version control. Sudo cannot be used in vs code. So how do I initialize, add, submit and manage mine? What about the code?

世界只因有你
世界只因有你

reply all(3)
PHPzhong

Obviously this is a permissions issue, but ubuntu usually comes with git, so it shouldn’t be the reason @notreami said. Here I need to confirm something:

  • Are you sure that when you use git in any folder, you will get a prompt about insufficient permissions?

It is recommended to try a more common folder. If your answer is no, it is likely that you do not have enough permissions on the current folder, that is, you do not have write permissions.

Of course, you can also use ls -l to view the permission information of the folder.

In addition, I tried it on my ubuntu system. I don’t have write permissions on the /opt directory, so I speculate that your html directory was created using sudo mkdir, so it’s not surprising that you have a problem like this.

大家讲道理

Is git installed under root permission? Uninstall git, and then install git under your user rights.

我想大声告诉你

Clone repo under root permission

yu install mei guan xi

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template