簡體   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