git 是否有任何 pull/checkout ‘nuclear option’ 来获取 repo? 我不关心任何冲突,我不需要任何本地的东西, 只是想要 cargo ,所以我可以工作。
[编辑] 澄清我的问题:
$ git pull
error: Your local changes to the following files would be overwritten by merge:
<...files I couldn't care less about...>
Please, commit your changes or stash them before you can merge.
error: The following untracked working tree files would be overwritten by merge:
<...more files I couldn't care less about...>
最佳答案
最好了解各种 git 命令,然后“立即”找到您需要的命令,因为您会多次遇到这种情况,并且在提示和 blame git 的同时零碎地学习。
编辑:我继续尝试所有选项,这应该可以。感谢 pauljz 的评论。
git clean -df # remove untracked files AND directories
git reset HEAD --hard # revert any uncommitted changes
以上应该是您所需要的。
其他选项:
git pull -f # replace local files even if you have unpushed commits.
或
git reset HEAD --hard # remove unchanged, uncommitted files
git pull
或
git clean -f # remove untracked files (uncommitted files)
git pull
关于git : give me the repo, 核对本地的一切,我不在乎,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16548486/