git正如书中所说,但错误发生了

时间:2016-03-29 14:55:31

标签: 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 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 pull remote

fatal: 'remote' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

然后git status

所以,我不知道哪里出错,谁能告诉我这个问题? 谢谢!

我已经尝试了3次以上,但仍然是同样的错误!请给我一些帮助,谢谢!!!

1 个答案:

答案 0 :(得分:0)

看起来你应该这样做

git pull origin master

你需要从github获得所有东西,这是你的起源。

当vim打开时,按i并写一条短信,然后按退出键。要保存信息,请按

:wq

这意味着写和退出。在那之后你应该能够做到这一点。