I am musing about building a big system on top of git for various reasons but mainly convenience.
But as part of the implementation I would end up making millions of branches and branching and merging between them. Can git actually scale this way? I always hear "Branches are free" but I have to wonder if this is really true x1,000,000? Can git actually create a theoretical unlimited number of branches?
Yes, branches are free. Branching and merging is very easy.
The scalability issues mentioned before comes only when synchronizing a vast amount of branches through the network (git fetch, git pull, git push). Locally you shouldn't have any problem.
There was a thread about scalability problems in this area on the git mailing list last year, as I recall there were some improvements made but I don't recall off hand what the performance was like with the changes that got incorporated into newer versions as a result.
Here's a link to an archive of that thread:
http://git.661346.n2.nabble.com/Git-is-not-scalable-with-too-many-refs-td6456443.html