Đây không phải là phiên bản "mới hơn", nhưng bạn có thể yêu cầu git luôn thích phiên bản trên nhánh hiện tại bằng cách sử dụng git merge branch -X ours
hoặc muốn sử dụng phiên bản git merge branch -X theirs
.
Từ man git-merge
:
ours:
This option forces conflicting hunks to be auto-resolved cleanly by favoring our version. Changes from the other tree that do not conflict with our side are reflected to the merge result. For a binary file, the entire contents are taken from our side.
theirs:
This is the opposite of "ours".
Nguồn
2012-11-27 22:34:32
thể trùng lặp của [git pull từ xa .. Tôi có thể buộc nó ghi đè lên chứ không phải là mâu thuẫn báo cáo?] (Http://stackoverflow.com/questions/4785107/git-pull-from-remote-can-i-force-it-to-overwrite-rather-than-report-conflicts) – Rawkode
nhưng tôi muốn thực hiện hợp nhất (không ghi đè các cam kết), nhưng ngoài ra để giải quyết xung đột tự động. – bartek