你好,我在命令git push -u origing master之后看到以下错误。有人可以帮忙吗
基本上我只是在尝试以下步骤
1) Go to github.com
2) Make repository called datasciencecoursera
3) Come back to git Bash tool
4) mkdir datasciencecoursera on local pc
5) cd to directory
6) git init
7) touch HelloWorld.md
8) git add HelloWorld.md
9) git commit -m "First comment"
10) git remote add origin https://github.com/adnan2911/datasciencecoursera.git
11) git push -u origin master
但我遇到错误
adnan@AB-DESKTOP MINGW64 ~/datasciencecoursera (master)
$ git push -u origin master
To https://github.com/adnan2911/datasciencecoursera.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/adnan2911/datasciencecours
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.
我尝试搜索快速转发,但由于我对git东西很陌生而无法理解
答案 0 :(得分:2)
该教程将无法正常运行,因为其中有一个HelloWorld.md
(一开始您可能不应该创建)。克隆它,您将自动将远程添加到本地存储库中:
git clone https://github.com/adnan2911/datasciencecoursera