社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
Py学习  »  Git

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

Community wiki • 1 年前 • 576 次点击  

尝试在个人项目中使用/学习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
 
576 次点击  
文章 [ 2 ]  |  最新文章 1 年前