繁体   English   中英

Git合并并选择冲突中的本地文件

[英]Git merge and select local file in conflicts

我有一个烧瓶项目,已部署到openshift,并在本地维护。 我从openshift删除了它,现在想重新部署它。 在openshift gui中,我创建了一个python应用程序,并获取了openshift git存储库;

 ssh://*******@myproject.rhcloud.com/~/git/myproject.git/

我通过以下方式将源更改为新的网址:

git remote set-url origin ssh://*******@myproject.rhcloud.com/~/git/myproject.git/

现在基于https://developers.openshift.com/en/knowledge-base.html#sync-a-new-git-repo-with-an-existing-git-repo我想要合并。

我试过了:

$ git pull ssh://*******@myproject.rhcloud.com/~/git/myproject.git/               

From ssh://*******@myproject.rhcloud.com/~/git/myproject.git/
 * branch            HEAD       -> FETCH_HEAD
Auto-merging wsgi.py
CONFLICT (add/add): Merge conflict in wsgi.py
Auto-merging .openshift/markers/README.md
CONFLICT (add/add): Merge conflict in .openshift/markers/README.md
Auto-merging .openshift/cron/README.cron
CONFLICT (add/add): Merge conflict in .openshift/cron/README.cron
Automatic merge failed; fix conflicts and then commit the result.

基本上到此为止,如果我理解正确,则在所有情况下都希望选择我的本地文件而不是远程文件。 做这个的最好方式是什么。

我怀疑可能会重新安排基准,但不确定。

如果要在远程文件上选择本地文件,请执行以下操作:

git checkout --ours wsgi.py
git checkout --ours .openshift/markers/README.md
git checkout --ours .openshift/cron/README.cron
git commit -a

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM