Local Workspaces Permissions Management and GitHub Integration











up vote
0
down vote

favorite












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.










share|improve this question


















  • 1




    who owns ~/workspaces (ls -l ~/workspaces), how do you launch vscode. And password aging can be used to prevent constant logins.
    – George Udosen
    Nov 17 at 13:30






  • 1




    it's keep coming up because you keep writing to that location as root... which should be.
    – George Udosen
    Nov 17 at 13:46















up vote
0
down vote

favorite












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.










share|improve this question


















  • 1




    who owns ~/workspaces (ls -l ~/workspaces), how do you launch vscode. And password aging can be used to prevent constant logins.
    – George Udosen
    Nov 17 at 13:30






  • 1




    it's keep coming up because you keep writing to that location as root... which should be.
    – George Udosen
    Nov 17 at 13:46













up vote
0
down vote

favorite









up vote
0
down vote

favorite











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.










share|improve this question













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.







permissions sudo git npm visual-studio-code






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 17 at 11:31









Andre

378




378








  • 1




    who owns ~/workspaces (ls -l ~/workspaces), how do you launch vscode. And password aging can be used to prevent constant logins.
    – George Udosen
    Nov 17 at 13:30






  • 1




    it's keep coming up because you keep writing to that location as root... which should be.
    – George Udosen
    Nov 17 at 13:46














  • 1




    who owns ~/workspaces (ls -l ~/workspaces), how do you launch vscode. And password aging can be used to prevent constant logins.
    – George Udosen
    Nov 17 at 13:30






  • 1




    it's keep coming up because you keep writing to that location as root... which should be.
    – George Udosen
    Nov 17 at 13:46








1




1




who owns ~/workspaces (ls -l ~/workspaces), how do you launch vscode. And password aging can be used to prevent constant logins.
– George Udosen
Nov 17 at 13:30




who owns ~/workspaces (ls -l ~/workspaces), how do you launch vscode. And password aging can be used to prevent constant logins.
– George Udosen
Nov 17 at 13:30




1




1




it's keep coming up because you keep writing to that location as root... which should be.
– George Udosen
Nov 17 at 13:46




it's keep coming up because you keep writing to that location as root... which should be.
– George Udosen
Nov 17 at 13:46










1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










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/






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1093701%2flocal-workspaces-permissions-management-and-github-integration%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote



    accepted










    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/






    share|improve this answer



























      up vote
      1
      down vote



      accepted










      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/






      share|improve this answer

























        up vote
        1
        down vote



        accepted







        up vote
        1
        down vote



        accepted






        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/






        share|improve this answer














        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/







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 17 at 13:41

























        answered Nov 17 at 13:11









        George Udosen

        18.3k94065




        18.3k94065






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1093701%2flocal-workspaces-permissions-management-and-github-integration%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Ellipse (mathématiques)

            Quarter-circle Tiles

            Mont Emei