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

时间:2016-02-07 17:28:31

标签: python git

我有一个烧瓶项目,我已经部署到openshift,我在本地维护。我从openshift中删除了它,现在想重新部署它。在openshift gui中,我创建了一个python app并抓住了openshift git repo;

 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.

基本上在这一点如果我理解正确,我想在所有情况下选择远程文件上的本地文件。什么是最好的方法。

我怀疑一个变种可能是有序但不确定。

1 个答案:

答案 0 :(得分:2)

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

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