Linux - How to Remove Git Credentials










15















I ran




git config credential.helper store




and ran




git push origin master




where I entered my credentials and they were saved.



I read that they were stored in plaintext, and so now I want to remove my credentials from being saved and entered by default.



How can I do this?










share|improve this question


























    15















    I ran




    git config credential.helper store




    and ran




    git push origin master




    where I entered my credentials and they were saved.



    I read that they were stored in plaintext, and so now I want to remove my credentials from being saved and entered by default.



    How can I do this?










    share|improve this question
























      15












      15








      15


      7






      I ran




      git config credential.helper store




      and ran




      git push origin master




      where I entered my credentials and they were saved.



      I read that they were stored in plaintext, and so now I want to remove my credentials from being saved and entered by default.



      How can I do this?










      share|improve this question














      I ran




      git config credential.helper store




      and ran




      git push origin master




      where I entered my credentials and they were saved.



      I read that they were stored in plaintext, and so now I want to remove my credentials from being saved and entered by default.



      How can I do this?







      linux git credentials






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked May 29 '17 at 16:24









      Max LiMax Li

      196119




      196119






















          5 Answers
          5






          active

          oldest

          votes


















          31














          Run the following command in the terminal to remove your credentials stored in the cache



          git config --global --unset credential.helper





          share|improve this answer


















          • 3





            This is the answer.

            – Aerin
            Aug 9 '18 at 4:02











          • After running this command, my credentials are still stored in ~/.git-credentials. (Ubuntu 18.04, git version 2.17.1) So as in @torek's answer, you should delete this file as well.

            – mh8020
            Feb 6 at 14:25


















          7














          Your credentials are stored in the file you (or the thing using git credential-store) specified when you (or it) ran the command, as described in the documentation. The default is $HOME/.git-credentials. You should be able to open this file in your editor and edit it, or simply remove it entirely.



          Note that you may also want to change the credential helper so that these are not stored again. See the git credential-cache documentation as well, for instance.






          share|improve this answer






























            4














            As he did not give any flag as global or local or system, it would take local by default, so the correct way is to move to the respective folder(repository) and type this command



            git config --local --unset credential.helper


            or



            git config --unset credential.helper


            Reference: https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-config






            share|improve this answer


















            • 1





              Thank you so much. It works for me :)

              – Quy Le
              Dec 7 '18 at 8:23


















            1














            If you would like the daemon to exit early, forgetting all cached credentials before their timeout, you can issue an exit action, run the following command.




            git credential-cache exit







            share|improve this answer






























              0














              None of the above solutions worked for me. I revoked the access by deletion of the token I had generated the machine.



              I logged into GitHub webpage went to:
              click picture > settings > Developer settings > Personal access tokens > delete the token for that particular machine






              share|improve this answer






















                Your Answer






                StackExchange.ifUsing("editor", function ()
                StackExchange.using("externalEditor", function ()
                StackExchange.using("snippets", function ()
                StackExchange.snippets.init();
                );
                );
                , "code-snippets");

                StackExchange.ready(function()
                var channelOptions =
                tags: "".split(" "),
                id: "1"
                ;
                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',
                autoActivateHeartbeat: false,
                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%2fstackoverflow.com%2fquestions%2f44246876%2flinux-how-to-remove-git-credentials%23new-answer', 'question_page');

                );

                Post as a guest















                Required, but never shown

























                5 Answers
                5






                active

                oldest

                votes








                5 Answers
                5






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                31














                Run the following command in the terminal to remove your credentials stored in the cache



                git config --global --unset credential.helper





                share|improve this answer


















                • 3





                  This is the answer.

                  – Aerin
                  Aug 9 '18 at 4:02











                • After running this command, my credentials are still stored in ~/.git-credentials. (Ubuntu 18.04, git version 2.17.1) So as in @torek's answer, you should delete this file as well.

                  – mh8020
                  Feb 6 at 14:25















                31














                Run the following command in the terminal to remove your credentials stored in the cache



                git config --global --unset credential.helper





                share|improve this answer


















                • 3





                  This is the answer.

                  – Aerin
                  Aug 9 '18 at 4:02











                • After running this command, my credentials are still stored in ~/.git-credentials. (Ubuntu 18.04, git version 2.17.1) So as in @torek's answer, you should delete this file as well.

                  – mh8020
                  Feb 6 at 14:25













                31












                31








                31







                Run the following command in the terminal to remove your credentials stored in the cache



                git config --global --unset credential.helper





                share|improve this answer













                Run the following command in the terminal to remove your credentials stored in the cache



                git config --global --unset credential.helper






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Oct 16 '17 at 7:16









                CoderCoder

                42644




                42644







                • 3





                  This is the answer.

                  – Aerin
                  Aug 9 '18 at 4:02











                • After running this command, my credentials are still stored in ~/.git-credentials. (Ubuntu 18.04, git version 2.17.1) So as in @torek's answer, you should delete this file as well.

                  – mh8020
                  Feb 6 at 14:25












                • 3





                  This is the answer.

                  – Aerin
                  Aug 9 '18 at 4:02











                • After running this command, my credentials are still stored in ~/.git-credentials. (Ubuntu 18.04, git version 2.17.1) So as in @torek's answer, you should delete this file as well.

                  – mh8020
                  Feb 6 at 14:25







                3




                3





                This is the answer.

                – Aerin
                Aug 9 '18 at 4:02





                This is the answer.

                – Aerin
                Aug 9 '18 at 4:02













                After running this command, my credentials are still stored in ~/.git-credentials. (Ubuntu 18.04, git version 2.17.1) So as in @torek's answer, you should delete this file as well.

                – mh8020
                Feb 6 at 14:25





                After running this command, my credentials are still stored in ~/.git-credentials. (Ubuntu 18.04, git version 2.17.1) So as in @torek's answer, you should delete this file as well.

                – mh8020
                Feb 6 at 14:25













                7














                Your credentials are stored in the file you (or the thing using git credential-store) specified when you (or it) ran the command, as described in the documentation. The default is $HOME/.git-credentials. You should be able to open this file in your editor and edit it, or simply remove it entirely.



                Note that you may also want to change the credential helper so that these are not stored again. See the git credential-cache documentation as well, for instance.






                share|improve this answer



























                  7














                  Your credentials are stored in the file you (or the thing using git credential-store) specified when you (or it) ran the command, as described in the documentation. The default is $HOME/.git-credentials. You should be able to open this file in your editor and edit it, or simply remove it entirely.



                  Note that you may also want to change the credential helper so that these are not stored again. See the git credential-cache documentation as well, for instance.






                  share|improve this answer

























                    7












                    7








                    7







                    Your credentials are stored in the file you (or the thing using git credential-store) specified when you (or it) ran the command, as described in the documentation. The default is $HOME/.git-credentials. You should be able to open this file in your editor and edit it, or simply remove it entirely.



                    Note that you may also want to change the credential helper so that these are not stored again. See the git credential-cache documentation as well, for instance.






                    share|improve this answer













                    Your credentials are stored in the file you (or the thing using git credential-store) specified when you (or it) ran the command, as described in the documentation. The default is $HOME/.git-credentials. You should be able to open this file in your editor and edit it, or simply remove it entirely.



                    Note that you may also want to change the credential helper so that these are not stored again. See the git credential-cache documentation as well, for instance.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered May 29 '17 at 18:21









                    torektorek

                    196k18244323




                    196k18244323





















                        4














                        As he did not give any flag as global or local or system, it would take local by default, so the correct way is to move to the respective folder(repository) and type this command



                        git config --local --unset credential.helper


                        or



                        git config --unset credential.helper


                        Reference: https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-config






                        share|improve this answer


















                        • 1





                          Thank you so much. It works for me :)

                          – Quy Le
                          Dec 7 '18 at 8:23















                        4














                        As he did not give any flag as global or local or system, it would take local by default, so the correct way is to move to the respective folder(repository) and type this command



                        git config --local --unset credential.helper


                        or



                        git config --unset credential.helper


                        Reference: https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-config






                        share|improve this answer


















                        • 1





                          Thank you so much. It works for me :)

                          – Quy Le
                          Dec 7 '18 at 8:23













                        4












                        4








                        4







                        As he did not give any flag as global or local or system, it would take local by default, so the correct way is to move to the respective folder(repository) and type this command



                        git config --local --unset credential.helper


                        or



                        git config --unset credential.helper


                        Reference: https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-config






                        share|improve this answer













                        As he did not give any flag as global or local or system, it would take local by default, so the correct way is to move to the respective folder(repository) and type this command



                        git config --local --unset credential.helper


                        or



                        git config --unset credential.helper


                        Reference: https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-config







                        share|improve this answer












                        share|improve this answer



                        share|improve this answer










                        answered Oct 5 '18 at 13:26









                        Karthik KannanKarthik Kannan

                        555




                        555







                        • 1





                          Thank you so much. It works for me :)

                          – Quy Le
                          Dec 7 '18 at 8:23












                        • 1





                          Thank you so much. It works for me :)

                          – Quy Le
                          Dec 7 '18 at 8:23







                        1




                        1





                        Thank you so much. It works for me :)

                        – Quy Le
                        Dec 7 '18 at 8:23





                        Thank you so much. It works for me :)

                        – Quy Le
                        Dec 7 '18 at 8:23











                        1














                        If you would like the daemon to exit early, forgetting all cached credentials before their timeout, you can issue an exit action, run the following command.




                        git credential-cache exit







                        share|improve this answer



























                          1














                          If you would like the daemon to exit early, forgetting all cached credentials before their timeout, you can issue an exit action, run the following command.




                          git credential-cache exit







                          share|improve this answer

























                            1












                            1








                            1







                            If you would like the daemon to exit early, forgetting all cached credentials before their timeout, you can issue an exit action, run the following command.




                            git credential-cache exit







                            share|improve this answer













                            If you would like the daemon to exit early, forgetting all cached credentials before their timeout, you can issue an exit action, run the following command.




                            git credential-cache exit








                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Jun 20 '18 at 15:29









                            Atchyut NagabhairavaAtchyut Nagabhairava

                            4692818




                            4692818





















                                0














                                None of the above solutions worked for me. I revoked the access by deletion of the token I had generated the machine.



                                I logged into GitHub webpage went to:
                                click picture > settings > Developer settings > Personal access tokens > delete the token for that particular machine






                                share|improve this answer



























                                  0














                                  None of the above solutions worked for me. I revoked the access by deletion of the token I had generated the machine.



                                  I logged into GitHub webpage went to:
                                  click picture > settings > Developer settings > Personal access tokens > delete the token for that particular machine






                                  share|improve this answer

























                                    0












                                    0








                                    0







                                    None of the above solutions worked for me. I revoked the access by deletion of the token I had generated the machine.



                                    I logged into GitHub webpage went to:
                                    click picture > settings > Developer settings > Personal access tokens > delete the token for that particular machine






                                    share|improve this answer













                                    None of the above solutions worked for me. I revoked the access by deletion of the token I had generated the machine.



                                    I logged into GitHub webpage went to:
                                    click picture > settings > Developer settings > Personal access tokens > delete the token for that particular machine







                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Nov 16 '18 at 2:36









                                    Sheece GardaziSheece Gardazi

                                    13110




                                    13110



























                                        draft saved

                                        draft discarded
















































                                        Thanks for contributing an answer to Stack Overflow!


                                        • Please be sure to answer the question. Provide details and share your research!

                                        But avoid


                                        • Asking for help, clarification, or responding to other answers.

                                        • Making statements based on opinion; back them up with references or personal experience.

                                        To learn more, see our tips on writing great answers.




                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function ()
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f44246876%2flinux-how-to-remove-git-credentials%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

                                        Top Tejano songwriter Luis Silva dead of heart attack at 64

                                        ReactJS Fetched API data displays live - need Data displayed static

                                        政党