尝试在个人项目中使用/学习 git。只有我和一个远程 git repo,一些提交,我陷入了失败的合并。我的很多文件现在也有 Git 合并冲突标记。
我如何告诉 git 把所有东西都扔掉,只用我的?
我如何进入我所处的状态的一个具体例子:
echo A new file > myFile.txt # example file
git add myFile.txt # add file
git commit # commit changes
git push # push changes to remote repo
echo A conflicting edit > myFile.txt # oh, no, forgot some changes
git add myFile.txt # add again
git commit --amend # amend previous commit
git push # fails. Git suggests to do a pull first
git pull origin HEAD # "Automatic merge failed" Now what?
# Just use what I have locally!