DEV Community

DonnieTD
DonnieTD

Posted on

How to push to a Git repo from a different account without config:

I keep having to find the answer to this question way too often, but way too not often enough to remember it...

So i'm just posting it here to remember it....

But if you need it too here it is :

$ git push https://Username:Password@github.com/Username/RepoName.git

Top comments (3)

Collapse
 
nicmeister profile image
Nicolaas Nel

Thanks @donnietd , Really needed this!

Collapse
 
marklai1998 profile image
Mark Lai

what if the account has 2FA enabled?

Collapse
 
donnietd profile image
DonnieTD

I think this would work ?

Didn't test it so please let us know?

help.github.com/en/github/authenti...