gitx - Can git ignore a specific line? -
i'm using git sync phonegap while testing on phone's native browser. such have following line:
var isphonegap = false; obviously change when building, there way can set git ignore 1 line or have go , put in own file , ignore way?
i'm using gitx , terminal on osx 10.6.
if file of specific type, can declare content filter driver, can declare in .gitattributes file (as presented in "keyword expansion" of "git attributes"):

*.yourtype filter=yourfiltername (you can set filter specific file, if want)
implement:
yourfiltername.smudge(triggered ongit checkout) ,git config --global filter.yourfiltername.smudge 'sed "s/isphonegap = .*/isphonegap = true/"'yourfiltername.clean(triggered ongit add)git config --global filter.yourfiltername.clean 'sed "s/isphonegap = .*/isphonegap = false/"'
your file appear unchanged on git status, yet checked out version have right value isphonegap.
Comments
Post a Comment