使用 Github 推送提交时出错:致命:无法读取用户名 [英] Error when push commits with Github: fatal: could not read Username
问题描述
因为很少有时间,我将 Github 用于我的项目,当我想推送提交时遇到了问题.
Since few time, I use Github for my projects and I have an issue when I want to push commits.
一开始,我已经分叉了一个存储库.然后我克隆了 fork(使用命令行 git clone https://github.com/...
),并且在进行修改后,我已经成功提交(git commit -a
).
To beginning, I have forked a repository. Then I have cloned the fork (with command line git clone https://github.com/ ...
) and, after doing modifications, I have committed with success (git commit -a
).
此后,我尝试使用命令行 git push
推送提交,但出现以下错误:
After this, I have tried to push commits with command line git push
but I obtain the following error:
fatal: could not read Username for 'https://github.com': No such file or directory
您有解决此问题的想法吗?
Have you got an idea to resolve this issue?
推荐答案
我必须做的是:
git remote rm origin
git remote add origin 'git@github.com:username/repo.git'
然后,我能够推送我的更改.
Then, I was able to push my changes.
这篇关于使用 Github 推送提交时出错:致命:无法读取用户名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!