0

I have a folder ~/workspaces where I place all my local repositories from GitHub and other coding projects.

I use VS Code and have had permissions problems since I installed Ubuntu a month ago. I receive the EACCES: permission denied in VS Code when I try to save files every single time after I did a git checkout branch. Is this normal?

I counter it with $ sudo chown -R <user-name> <directory-name> and sudo chmod -R 777 . (I do not really know whats the difference anyway) but it keeps coming up again.

Also, I thought doing sudo npm i is a bad thing but I keep getting Access Denied Errors for both local and global installations with npm if I do not sudo. How can I prevent this?

Finally, I would love to automatically login with GitHub via console without the need to constantly login with username and password. A quick Google could not find me a solution. How can I integrate an Access Token for the whole workspace folder (all repositories)? Is this possible?

Thank you very much for your support, it is much appreciated!

I am on Ubuntu 18.04.1 LTS btw.

2
  • 1
    who owns ~/workspaces (ls -l ~/workspaces), how do you launch vscode. And password aging can be used to prevent constant logins. Nov 17, 2018 at 13:30
  • 1
    it's keep coming up because you keep writing to that location as root... which should be. Nov 17, 2018 at 13:46

1 Answer 1

1

Turn on the credential helper so that Git will save your password in memory for some time. By default, Git will cache your password for 15 minutes.

git config --global credential.helper cache
# Set git to use the credential memory cache

git config --global credential.helper 'cache --timeout=3600'
# Set the cache to timeout after 1 hour (setting is in seconds)

See: https://help.github.com/articles/caching-your-github-password-in-git/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .