Py学习  »  Git

Git:目前与私有远程回购存在合并/冲突。如何告诉Git只使用我的本地文件?

Community wiki • 11 月前 • 389 次点击  

尝试在个人项目中使用/学习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!
Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/155793
 
389 次点击  
文章 [ 2 ]  |  最新文章 11 月前