Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Python
  3. Question
Python

git login command line-login to github from command line with multiple accounts

Asked by Alexander Coxon Jul 5, 2021 2.6K views 1 answer
Share

About this question

I opened a new GitHub account to separate my biz vs. personal repository.

Now, I git init my local repo and git add remote origin 

I try to push and it seems to always take the credentials of my original account, not prompting me for the credentials for the new account.

I tried using the URL format with

https://:@github.com//

but that doesn't seem to help: I still get an error that the credentials are invalid for the original account username.

How do I log in with multiple sets of credentials or how would I somehow reset the original credentials to force password prompt when pushing? What should be the git login command?


 

EDIT:

The only way I managed to push right now is by specifying the username:password@github.com/ in the url in the git push command 

Your answer

1 Answer

More Python discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Python Blogs

Guides, tips and career advice on Python from JanBask experts.