I have a config file in our project that holds a connection string to the database, as well as several application settings, e.g:
...
<setting name="ConnectionString"><value>Server=prodServer;Database=myDataBase;</value></setting>
<setting name="AnotherSetting1"><value>Lorem</value></setting>
<setting name="AnotherSetting2"><value>Ipsum</value></setting>
<setting name="AnotherSetting3"><value>dolor </value></setting>
...
During my development, I always change the ConnectionString value to my local database which causes git to put the file mark the file as "modified".
I read about the option of doing the following:
git update-index --assume-unchanged app.config
However, that would mean that if I do ANY other change to the file (e.g, change AnotherSetting1) then git would ignore that as well.
Is there a way to tell git to ignore a specific change in file, but to mark it as modified if any other changes occur? Or is there another similar solution to this problem?
Please assume that I can't make any changes to architecture of the config file itself - I'd like a local-only solution.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…