ced*_*dlb 14
我有一个类似的问题。
TL;DR 短版相关命令:
git init
git remote add origin git@github.com:somecompany/some-repo.git
git add .
git pull origin master
Run Code Online (Sandbox Code Playgroud)
全文:我在克隆 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)
Run Code Online (Sandbox Code Playgroud)
然后我添加了原点
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
Run Code Online (Sandbox Code Playgroud)
我尝试了几件没有帮助的事情,最后我做到了:
git add .
这些文件现在都已上演,但我没有提交。相反,我做了:
git pull origin master
哪个输出:
From github.com:somecompany/some-repo
* branch master -> FETCH_HEAD
Run Code Online (Sandbox Code Playgroud)
现在,当我这样做时,git status
它报告了:
On branch master
nothing to commit, working tree clean
Run Code Online (Sandbox Code Playgroud)
我很高兴去。
归档时间: |
|
查看次数: |
4145 次 |
最近记录: |