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"):

http://git-scm.com/figures/18333fig0702-tn.png

*.yourtype filter=yourfiltername 

(you can set filter specific file, if want)

implement:

  • yourfiltername.smudge (triggered on git checkout) ,

    git config --global filter.yourfiltername.smudge 'sed "s/isphonegap = .*/isphonegap = true/"' 
  • yourfiltername.clean (triggered on git 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

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -