visual-studio-code - 为什么ubuntu 系统上每次进行git 指令时如果不加上sudo就会提示权限不够,无法操作呢?
世界只因有你
世界只因有你 2017-05-02 09:49:11
0
3
830

比如我在任意文件夹如/opt/html下建立git仓库,输入git init指令,回车就会提示/opt/html/.git: 权限不够,加上sudo 之后就可以,我想不加sudo 就给他权限可以吗,这样每次sudo好麻烦,而且我现在用visual studio code来版本控制,在vs code里面是用不了sudo的哦,那么我怎么去初始化,添加,提交管理我的代码呢?

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

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!