ced*_*dlb 14
我有一个类似的问题。
TL;DR 短版相关命令:
git init
git remote add origin git@github.com:somecompany/some-repo.git
git add .
git pull origin master
全文:我在克隆 repo 时遇到了麻烦,所以我最终下载并扩展了 zip。我做了git init之后git status显示:
On branch master
No commits yet
Untracked files:
  (use "git add <file>..." to include in what will be committed)
    .gitignore
    .rspec
    .ruby-version
    ...(all the directories of the project)...
nothing added to commit but untracked files present (use "git add" to track)
然后我添加了原点
git remote add origin git@github.com:somecompany/some-repo.git
我做了一个git fetch获取遥控器分支信息的操作。
我做的git pull origin master时候说:
From github.com:somecompany/some-repo
 * branch            master     -> FETCH_HEAD
error: The following untracked working tree files would be overwritten by merge:
    .gitignore
    .rspec
    .ruby-version
    ...(all the files of the project)...
Please move or remove them before you merge.
Aborting
我尝试了几件没有帮助的事情,最后我做到了:
git add .
这些文件现在都已上演,但我没有提交。相反,我做了:
git pull origin master 哪个输出:
From github.com:somecompany/some-repo
 * branch            master     -> FETCH_HEAD
现在,当我这样做时,git status它报告了:
On branch master
nothing to commit, working tree clean
我很高兴去。