Git doesn't ask me for username and password after pushing, but I am pushing to another remote












1















I have been pushing to a public repo for a long time, everytime when I do git push, I didn't have to enter username/password, the pushing process just happened instantly when I hit Enter.



Today I want to push my project to my private repo, after adding my private repo to my remote using git remote add private <url>,I tried git push but a fatal error came out and said "authentication failed, invalid username or password".



I mean, I couldn't even enter my username or password, so the username or password I have right now is probably for my public repo. So how do I make git to let me enter username and password again?










share|improve this question

























  • what is the scheme of your remote?

    – Dan Farrell
    Jan 1 at 1:36











  • @DanFarrell I'm sorry for being a noob, but what does scheme mean?

    – L. Z.
    Jan 1 at 1:57











  • @L.Z. The first portion of the URL, prior to the domain (e.g. https:// or git:)

    – Andrey Akhmetov
    Jan 1 at 2:01











  • @AndreyAkhmetov I tried both HTTPS and SSH, neither worked. I just didn't have username/pw prompt.

    – L. Z.
    Jan 1 at 2:23











  • That response would probably be better directed at @DanFarrell as a response to his comment; I'm not as familiar with Git as he might be

    – Andrey Akhmetov
    Jan 1 at 2:35
















1















I have been pushing to a public repo for a long time, everytime when I do git push, I didn't have to enter username/password, the pushing process just happened instantly when I hit Enter.



Today I want to push my project to my private repo, after adding my private repo to my remote using git remote add private <url>,I tried git push but a fatal error came out and said "authentication failed, invalid username or password".



I mean, I couldn't even enter my username or password, so the username or password I have right now is probably for my public repo. So how do I make git to let me enter username and password again?










share|improve this question

























  • what is the scheme of your remote?

    – Dan Farrell
    Jan 1 at 1:36











  • @DanFarrell I'm sorry for being a noob, but what does scheme mean?

    – L. Z.
    Jan 1 at 1:57











  • @L.Z. The first portion of the URL, prior to the domain (e.g. https:// or git:)

    – Andrey Akhmetov
    Jan 1 at 2:01











  • @AndreyAkhmetov I tried both HTTPS and SSH, neither worked. I just didn't have username/pw prompt.

    – L. Z.
    Jan 1 at 2:23











  • That response would probably be better directed at @DanFarrell as a response to his comment; I'm not as familiar with Git as he might be

    – Andrey Akhmetov
    Jan 1 at 2:35














1












1








1








I have been pushing to a public repo for a long time, everytime when I do git push, I didn't have to enter username/password, the pushing process just happened instantly when I hit Enter.



Today I want to push my project to my private repo, after adding my private repo to my remote using git remote add private <url>,I tried git push but a fatal error came out and said "authentication failed, invalid username or password".



I mean, I couldn't even enter my username or password, so the username or password I have right now is probably for my public repo. So how do I make git to let me enter username and password again?










share|improve this question
















I have been pushing to a public repo for a long time, everytime when I do git push, I didn't have to enter username/password, the pushing process just happened instantly when I hit Enter.



Today I want to push my project to my private repo, after adding my private repo to my remote using git remote add private <url>,I tried git push but a fatal error came out and said "authentication failed, invalid username or password".



I mean, I couldn't even enter my username or password, so the username or password I have right now is probably for my public repo. So how do I make git to let me enter username and password again?







git






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 1 at 1:58







L. Z.

















asked Jan 1 at 1:32









L. Z.L. Z.

487




487













  • what is the scheme of your remote?

    – Dan Farrell
    Jan 1 at 1:36











  • @DanFarrell I'm sorry for being a noob, but what does scheme mean?

    – L. Z.
    Jan 1 at 1:57











  • @L.Z. The first portion of the URL, prior to the domain (e.g. https:// or git:)

    – Andrey Akhmetov
    Jan 1 at 2:01











  • @AndreyAkhmetov I tried both HTTPS and SSH, neither worked. I just didn't have username/pw prompt.

    – L. Z.
    Jan 1 at 2:23











  • That response would probably be better directed at @DanFarrell as a response to his comment; I'm not as familiar with Git as he might be

    – Andrey Akhmetov
    Jan 1 at 2:35



















  • what is the scheme of your remote?

    – Dan Farrell
    Jan 1 at 1:36











  • @DanFarrell I'm sorry for being a noob, but what does scheme mean?

    – L. Z.
    Jan 1 at 1:57











  • @L.Z. The first portion of the URL, prior to the domain (e.g. https:// or git:)

    – Andrey Akhmetov
    Jan 1 at 2:01











  • @AndreyAkhmetov I tried both HTTPS and SSH, neither worked. I just didn't have username/pw prompt.

    – L. Z.
    Jan 1 at 2:23











  • That response would probably be better directed at @DanFarrell as a response to his comment; I'm not as familiar with Git as he might be

    – Andrey Akhmetov
    Jan 1 at 2:35

















what is the scheme of your remote?

– Dan Farrell
Jan 1 at 1:36





what is the scheme of your remote?

– Dan Farrell
Jan 1 at 1:36













@DanFarrell I'm sorry for being a noob, but what does scheme mean?

– L. Z.
Jan 1 at 1:57





@DanFarrell I'm sorry for being a noob, but what does scheme mean?

– L. Z.
Jan 1 at 1:57













@L.Z. The first portion of the URL, prior to the domain (e.g. https:// or git:)

– Andrey Akhmetov
Jan 1 at 2:01





@L.Z. The first portion of the URL, prior to the domain (e.g. https:// or git:)

– Andrey Akhmetov
Jan 1 at 2:01













@AndreyAkhmetov I tried both HTTPS and SSH, neither worked. I just didn't have username/pw prompt.

– L. Z.
Jan 1 at 2:23





@AndreyAkhmetov I tried both HTTPS and SSH, neither worked. I just didn't have username/pw prompt.

– L. Z.
Jan 1 at 2:23













That response would probably be better directed at @DanFarrell as a response to his comment; I'm not as familiar with Git as he might be

– Andrey Akhmetov
Jan 1 at 2:35





That response would probably be better directed at @DanFarrell as a response to his comment; I'm not as familiar with Git as he might be

– Andrey Akhmetov
Jan 1 at 2:35












1 Answer
1






active

oldest

votes


















2














You probably enabled Git Credential Manager when you installed git or the first time you pushed to a repo. Git Credential Manager caches and re-uses credentials between different push commands, so it could be re-using credentials for a different remote. Without credential manager, you would have to type in your credentials on every push.



Please follow the advice in this SO post to clear your credentials. Note the 2nd answer is specific to Windows Devices, whereas the first should work for MacOS and Linux.






share|improve this answer



















  • 1





    Thanks. This solved the problem like magic. Removing the credential from the vault did prompt me password entry for me.

    – L. Z.
    Jan 1 at 5:14











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%2f53992520%2fgit-doesnt-ask-me-for-username-and-password-after-pushing-but-i-am-pushing-to%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









2














You probably enabled Git Credential Manager when you installed git or the first time you pushed to a repo. Git Credential Manager caches and re-uses credentials between different push commands, so it could be re-using credentials for a different remote. Without credential manager, you would have to type in your credentials on every push.



Please follow the advice in this SO post to clear your credentials. Note the 2nd answer is specific to Windows Devices, whereas the first should work for MacOS and Linux.






share|improve this answer



















  • 1





    Thanks. This solved the problem like magic. Removing the credential from the vault did prompt me password entry for me.

    – L. Z.
    Jan 1 at 5:14
















2














You probably enabled Git Credential Manager when you installed git or the first time you pushed to a repo. Git Credential Manager caches and re-uses credentials between different push commands, so it could be re-using credentials for a different remote. Without credential manager, you would have to type in your credentials on every push.



Please follow the advice in this SO post to clear your credentials. Note the 2nd answer is specific to Windows Devices, whereas the first should work for MacOS and Linux.






share|improve this answer



















  • 1





    Thanks. This solved the problem like magic. Removing the credential from the vault did prompt me password entry for me.

    – L. Z.
    Jan 1 at 5:14














2












2








2







You probably enabled Git Credential Manager when you installed git or the first time you pushed to a repo. Git Credential Manager caches and re-uses credentials between different push commands, so it could be re-using credentials for a different remote. Without credential manager, you would have to type in your credentials on every push.



Please follow the advice in this SO post to clear your credentials. Note the 2nd answer is specific to Windows Devices, whereas the first should work for MacOS and Linux.






share|improve this answer













You probably enabled Git Credential Manager when you installed git or the first time you pushed to a repo. Git Credential Manager caches and re-uses credentials between different push commands, so it could be re-using credentials for a different remote. Without credential manager, you would have to type in your credentials on every push.



Please follow the advice in this SO post to clear your credentials. Note the 2nd answer is specific to Windows Devices, whereas the first should work for MacOS and Linux.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 1 at 2:50









nareddytnareddyt

477410




477410








  • 1





    Thanks. This solved the problem like magic. Removing the credential from the vault did prompt me password entry for me.

    – L. Z.
    Jan 1 at 5:14














  • 1





    Thanks. This solved the problem like magic. Removing the credential from the vault did prompt me password entry for me.

    – L. Z.
    Jan 1 at 5:14








1




1





Thanks. This solved the problem like magic. Removing the credential from the vault did prompt me password entry for me.

– L. Z.
Jan 1 at 5:14





Thanks. This solved the problem like magic. Removing the credential from the vault did prompt me password entry for me.

– L. Z.
Jan 1 at 5:14




















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%2f53992520%2fgit-doesnt-ask-me-for-username-and-password-after-pushing-but-i-am-pushing-to%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

Monofisismo

Angular Downloading a file using contenturl with Basic Authentication

Olmecas