【发布时间】:2020-02-27 10:18:47
【问题描述】:
我是 Github 上的新手,正在尝试将我的第一个 master 分支推送到我的远程存储库。
在 Git bash 中,我输入了 git remote add origin https://github/...
但是当我第一次输入git push -u origin master时,我在弹窗中输入了错误的用户名和密码..T^T
然后,它就给了我
remote: Invalid username or password.
fatal: Authentication failed for 'https://github/...'
所以我尝试使用
git remote set-url origin https://github/...
又是git push -u origin master,
但它向我显示了相同的错误消息..
我该如何解决这个问题?
【问题讨论】:
-
您在 Windows 上工作吗?打开凭据管理器并删除
https://github/...的条目。 -
@ElpieKay 哇,它确实有帮助!谢谢,但我又遇到了一个错误..
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 dohint: not have locally. This is usually caused by another repository pushinghint: to the same ref. You may want to first integrate the remote changeshint: (e.g., 'git pull ...') before pushing again.hint: See the 'Note about fast-forwards' in 'git push --help' for details. -
见stackoverflow.com/questions/28429819/…。您可以在下一次推送之前运行
git fetch origin master或git fetch origin -r master。