git正如书中所说,但出现了错误

git正如书中所说,但出现了错误,git,Git,1.我只是创建并初始化了一个文件夹,并将其设置为存储库,然后在其中添加了2个文件夹。我一次就把它们放在一起。然后我添加了远程存储库,但当我开始推送它时,错误出现了:下面是我编写的代码和错误: git init git add 2048-personal git add canvas-time-counter git commit git remote add origin git@github.com:CharlesLN/front_end.git git push -u origin mast

1.我只是创建并初始化了一个文件夹,并将其设置为存储库,然后在其中添加了2个文件夹。我一次就把它们放在一起。然后我添加了远程存储库,但当我开始推送它时,错误出现了:下面是我编写的代码和错误:

git init
git add 2048-personal
git add canvas-time-counter
git commit
git remote add origin git@github.com:CharlesLN/front_end.git
git push -u origin master
然后错误出现了:

To git@github.com:CharlesLN/front_end.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'git@github.com:CharlesLN/front_end.git'
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 pull
然后信息:

warning: no common commits
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 3
Unpacking objects: 100% (3/3), done.
From github.com:CharlesLN/front_end
*[new branch] master     -> origin/master
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

git branch --set-upstream-to=origin/<branch> master
然后
git状态

所以,我不知道哪里出了问题,谁能告诉我问题出在哪里? 谢谢大家!


我已经试了3次以上了,结果还是一样的错误!请给我一些帮助,谢谢

看起来你应该这样做

git pull origin master
您需要从github获取所有信息,这是您的来源

当vim打开时,按i并编写短消息,然后按escape。要储存信息,请按

:wq

也就是说写下并退出。之后,您应该可以进行推送操作。

但它会弹出一个窗口,让我输入提交消息,以解释为什么需要进行此合并,……但我不知道如何返回到公用窗口编写消息并保存和退出编辑器。你在git中使用哪个文本编辑器?我想是vim,但我认为重要的是我不能推动它。
:wq