I have two accounts on Github, each with a specific use.
I would like to make sure that every time I push my name and password, I can do uploud with the right account.
But it doesn't happen, I use the https connection for this instead of the ssh.
Now going on the keychain, I saw that there are two keys found. One key for userA and one key for userB, both for Github.
Can you give me a hand?
Get yourself a personal access token as described in https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token
Once you have a personal access token you can use it as a password for your account. So you get one for each account.
To use your personal access token add your github account name and use the token as password to the http URL using the username:passowrd@ syntax. For example if you want to clone my httpstress repo you can do:
git clone https://YOUR_GITUB_ACCOUNT:[email protected]/slebetman/httpstress.git
If you have already cloned your repo you can edit your .git/config file and edit your github URL to include your account name and personal access token. Find the following section in your .git/config file:
[remote "origin"]
url = https://github.com/slebetman/httpstress.git
fetch = +refs/heads/*:refs/remotes/origin/*
And change it as follows:
[remote "origin"]
url = https://YOUR_GITUB_ACCOUNT:[email protected]/slebetman/httpstress.git
fetch = +refs/heads/*:refs/remotes/origin/*
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With