git 忽略本地修改,不將修改提交到遠程

本地項目的配置文件自己修改了不想提交到倉庫,每次都要rollback非常不方便。可以試下這個方法:

忽略:

git update-index --assume-unchanged ./sd-schedule/src/main/resources/properties/redis.properties

那麼這個redis.properties就會被忽略,提交時檢測不到修改:


恢復:

$ git update-index --no-assume-unchanged ./sd-schedule/src/main/resources/properties/redis.properties

執行後就能正常提交修改了


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章