美文网首页
git 忽略本地修改,不将修改提交到远程

git 忽略本地修改,不将修改提交到远程

作者: 尹楷楷 | 来源:发表于2021-07-07 18:57 被阅读0次

本地项目的配置文件自己修改了不想提交到仓库,每次都要rollback非常不方便。可以试下这个方法:

忽略:

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

那么这个redis.properties就会被忽略,提交时检测不到修改:


image.png

恢复:

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

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


image.png

相关文章

网友评论

      本文标题:git 忽略本地修改,不将修改提交到远程

      本文链接:https://www.haomeiwen.com/subject/wekaultx.html