0

I am a newbie on Github, and trying to push my first master branch to my remote repository.

In the Git bash, I typed git remote add origin https://github/...

but when I firstly typed git push -u origin master, I typed wrong username and password on the pop-up window..T^T

and after then, it just gives me

remote: Invalid username or password.

fatal: Authentication failed for 'https://github/...'

So I tried to use

git remote set-url origin https://github/... and git push -u origin master again,

but it shows me the same error message..

How can I fix this problem?

mario119
  • 343
  • 3
  • 14
  • Are you working on Windows? Open Credential Manager and delete the entry of `https://github/...`. – ElpieKay Nov 01 '19 at 03:38
  • @ElpieKay Wow, it does help! Thanks, but I got another error.. `To https://github/...` `! [rejected] master -> master (fetch first)` `error: failed to push some refs to 'https://github/...'` `hint: Updates were rejected because the remote contains work that you do` `hint: not have locally. This is usually caused by another repository pushing` `hint: to the same ref. You may want to first integrate the remote changes` `hint: (e.g., 'git pull ...') before pushing again.` `hint: See the 'Note about fast-forwards' in 'git push --help' for details.` – mario119 Nov 01 '19 at 03:47
  • See https://stackoverflow.com/questions/28429819/rejected-master-master-fetch-first/42057061. You could run `git fetch origin master` or `git fetch origin -r master` before a next push. – ElpieKay Nov 01 '19 at 04:24

1 Answers1

0

You should trying remove : Credential Manager on Windows

  1. Open Control Panel.
  2. Click on User Accounts.
  3. Click on Credential Manager.
  4. Click the Windows Credentials tab (or Web Credentials).
  5. Select the account Github
  6. Click the Remove button.
  7. Delete Windows Credential
  8. Click the Yes button.
  9. Try type account & password again
TaiNa
  • 21
  • 2