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

执行后就能正常提交修改了


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