如果系統中有一些配置檔案在伺服器上做了配置修改,然後後續開發又新添加一些配置項的時候,
在釋出這個配置檔案的時候,會發生代碼沖突:
error: Your local changes to the following files would be overwritten by merge:
protected/config/main.php
Please, commit your changes or stash them before you can merge.
如果希望保留生産伺服器上所做的改動,僅僅并入新配置項, 處理方法如下:
反過來,如果希望用代碼庫中的檔案完全覆寫本地工作版本. 方法如下:
git checkout HEAD file/to/restore
本文轉自 IT阿飛 51CTO部落格,原文連結:http://blog.51cto.com/itafei/1945558