Tag Archives: Git

Configure git to ignore a range of code

I had been asked to recompile a VPAID ActionScript SWF with a minor change to the code, but I had a lot of stuff lingering in my build I would like to temporarily disable, by commenting out, then only commit the minor change asked by using prune, ie: git add -p file.as. There was a lot of things that had changed, and it was becoming difficult to spot the changes, with all of the commented out code everywhere.

A few Google searches later, I stumbled upon a neat solution which meets my particular needs. I can mark ranges of code, and have git commit / diff ignore them. Then I can mark things that are commented out, and/or not meant for commit, and they will not be in my way. Read more »