I think Torvalds intended it as a joke. He does have a reputation for abrasive behaviour
and seems to like his reputation. If he behaved like that towards me, I might be tempted to call him a git and I'm sure others have done, so he's saying "okay, I'm a git".
In Britain, "git" is a common enough (and mild enough) insult to make it into
Harry Potter and the Goblet of Fire.