Git Init - Permission Denied

Git Init - Permission Denied

When I try git init I get permission denied. I'm new to Ubuntu. What might be the reason?

Terminal:

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

I tried git init direction and 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

Thanks for help.

1 Answer

Git wasn't installed in main environment. python36 didn't have permissions and sudo git init didn't work because git wasn't installed.

Lines of code that helped:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Robert Thorne
Author

Robert Thorne

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.