所以。烦人。从版本库中删除本地更改
编辑为简洁:
$ git pull origin master
* branch master -> FETCH_HEAD
error: The following untracked working tree files would be overwritten by merge:
app/models/page.rb
Please move or remove them before you can merge.
Aborting
$ git reset --hard
HEAD is now at d90309f
$ git pull origin master
* branch master -> FETCH_HEAD
error: The following untracked working tree files would be overwritten by merge:
app/models/page.rb
Please move or remove them before you can merge.
Aborting
$ git rm --cached
usage: git rm [options] [--] <file>...
-n, --dry-run dry run
-q, --quiet do not list removed files
--cached only remove from the index
-f, --force override the up-to-date check
-r allow recursive removal
--ignore-unmatch exit with a zero status even if nothing matched
$ git pull origin master
From https://github.com/Jinxy5/laughing-octo-lana
* branch master -> FETCH_HEAD
error: The following untracked working tree files would be overwritten by merge:
app/models/page.rb
Please move or remove them before you can merge.
Aborting
$ git rm --cached app/models/page.rb
fatal: pathspec 'app/models/page.rb' did not match any files
答案类似的问题状态git rm --cached
来解决这些问题,但我做错了?因为它说它不匹配任何文件?也许是因为我运行git reset?
我是否用'u'替换了一个提交ID?我做到了这一点,它没有做任何事情。 – Starkers