【发布时间】:2018-09-30 13:14:23
【问题描述】:
我完成了使用命令行将现有项目添加到 GitHub 时给出的过程:
1. 更改目录
2. git初始化
3. git add .
4. git commit -m "第一次提交"
5. git远程添加源https://github.com/fitz00/Mega-Grazio.git
6.git远程-v
但是每当我运行最终命令时;
7. git push origin master
我总是收到这个错误:->
fatal: HttpRequestException encountered.
An error occurred while sending the request.
Username for 'https://github.com': fitz00
To https://github.com/fitz00/Mega-Grazio.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/fitz00/Mega-Grazio.git'
hint: Updates were rejected because the tip of your current branch is behind<br>
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
在存储库中,有两 (2) 个自动生成的文件 LICENSE 和 ReadMe.md。
请问如何绕过这个错误?
【问题讨论】:
-
为什么不只是
git pull远程更改,正如 git 所建议的那样?!