尝试在个人项目中使用/学习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!