当我尝试时,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 direction
过sudo 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