I would be interested to in knowing how you out there handle the bumping the version number for new releases issue.
How do you handle the version number in
I think that the standard way to do this is to use Git's hook system and m4 or sed/awk to do the search/replace as you suggest. You just need a special token with in a comment in each file (probably in the header).
Here's the reference on githooks and here's a few pages written by people solving the same problem:
Both of these rely on storing the version number in a file somewhere in your source tree.
I also came across a took called 0release that claims to automate release creation (and setting version numbers).
Finally, regarding release numbers, this is addressed in several other questions: