On my local branch, I have some personal (local-only) changes to a Makefile (just changing the path to the compiler). Obviously I don\'t want to commit those changes in as they
Why not fix the Makefile to use a variable for the path to the compiler instead of something hard-coded? Then you can just set the proper value in your environment. A lot of these (like CC for the C compiler, CPP for the C Preprocessor, etc, are pre-set by make). If yours is not, you can give it a default value that can be overridden by an environment variable. This example assume GNU make, other make utilities allow similar solutions:
FOO ?= /usr/bin/foo
test:
@echo CC is ${CC}
@echo FOO is ${FOO}
(make sure to use real tabs).
This gives:
$ make
CC is cc
FOO is /usr/bin/foo
$ export FOO=/opt/bin/foo
$ make
CC is cc
FOO is /opt/bin/foo
$ make FOO=/just/this/once
CC is cc
FOO is /just/this/once
This is a much more maintainable solution, and avoids the risk of one day accidentally pushing your local-only changes upstream.