git init-权限被拒绝

git init-权限被拒绝

当我尝试时,git init我得到了permission denied。我是 Ubuntu 新手。可能是什么原因?

终端:

(python36) jkbielan@jkbielan:~/python/projects/leetcode-python$ git init
/home/jkbielan/python/projects/leetcode-python/.git: Permission denied

我尝试git init directionsudo git init direction

(python36) jkbielan@jkbielan:~/python/projects/leetcode-python$ git init /home/jkbielan/python/projects/leetcode-python
/home/jkbielan/python/projects/leetcode-python/.git: Permission denied
(python36) jkbielan@jkbielan:~/python/projects/leetcode-python$ sudo git init /home/jkbielan/python/projects/leetcode-python
sudo: git: command not found

感谢帮助。

答案1

Git 未安装在主环境中。python36没有权限并且由于未安装而sudo git init无法工作。git

有帮助的代码行:

source deactivate python36
sudo apt-get install git
git init /home/jkbielan/python/projects/leetcode-python

相关内容