I was using an account in Github to push my projects to my repositories. Things were going well until I had the idea to create another account to put some projects that I believe are not important. Also I want to avoid having my main account bloated with projects that are not priority at the moment. As I tried to push my first unimportant project to my second account I received some error as I tried the steps
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/myaccount/myrepo.git
git push -u origin master
I remembered that I was using another account.So like anyone that knows little of Git/Gihub.
I tried like crazy to fire the commands that could produce some effect, without acctually knowing what I was doing:
git config user.email "secondaccount@email"
git config user.password "secondaccountpassword"
git config --global user.email "secondaccount@email"
git config--global user.password "secondaccountpassword"
But no results. It says prints the exactly link to my repo and says that it doesn't exists.
remote: Repository not found. fatal: repository ' https://github.com/myaccount/mkt.git/ ' not found
How can I diagnose this error?
Git is caching your login credentials. Use this to disable it:
git config --system --unset credential.helper
The git config user data is only used as an identity for commits, although Github uses the email to determine which user authored the commit.
And the correct config settings are user.name
and user.email
.
I am using Windows 10, I typed Credential Manager and opened a utiltiy that I've never paid attention of. There had github entry so I changed to my second account and it worked. It was getting my account info from there.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.