2、解決衝突
第一種,利用update的選項進行衝突解決,也就是說不管當前拷貝副本是否是最新版本,都使用—accept參數作為衝突處理方式
--accept ARG : specify automatic conflict resolution action
('postpone', 'base', 'mine-conflict',
'theirs-conflict', 'mine-full', 'theirs-full',
'edit', 'launch')
(p) postpone - mark the conflict to be resolved later //讓文件在更新完成之後保持衝突狀態。
(df) diff-full - show all changes made to merged file //使用標準區別格式顯示base修訂版本和衝突文件本身的區別。
(e) edit - change merged file in an editor //用你喜歡的編輯器打開衝突的文件,編輯器是環境變量EDITOR設置的。
(r) resolved - accept merged version of file //完成文件編輯之後,通知svn你已經解決了文件的衝突,它必須接受當前的內容—從本質上講就是你已經“解決了”衝突。
(mf) mine-full - accept my version of entire file (ignore their change//丟棄新從服務器接收的變更,並只使用你查看文件的本地修改。
(tf) theirs-full - accept their version of entire file (lose my changes)//丟棄你對查看文件的本地修改,只使用從服務器新接收的變更。
(l) launch - launch external tool to resolve conflict//啟動一個外置程序來執行衝突解決,這需要一些預先的準備。
(h) help - show this list //顯示所有在衝突解決時可能使用的命令。
第二種,在update時並不處理衝突,利用svn resolve解決衝突
1、利用svn resolve --accept base選擇base版本,即1.txt.rOld作為最後提交的版本
--accept ARG : specify automatic conflict resolution source
('base', 'working', 'mine-conflict',
'theirs-conflict', 'mine-full', 'theirs-full')
2、手工修改1.txt文件,然後將當前拷貝即1.txt作為最後提交的版本
svn resolve --accept working 1.txt
3、svn resolve --accept theirs-full 1.txt 使用1.txt.rNew作為最後提交的版本
4、svn resolve --accept mine-full 1.txt 使用1.txt.mine作為最後提交的版本
5、svn resolve --accept mine-conflict 1.txt 使用1.txt.mine的衝突部分作為最後提交的版本
5、svn resolve --accept theirs-conflict 1.txt 使用1.txt.rNew的衝突部分作為最後提交的版本
第三種,使用svn revert取消變更