Both because of technical itches he wanted scratched.
With Linux it was the ability to use unix without having to stomp over to the university computer lab during the Finnish winter.
With git it was creating something that could handle merging patches from a disparate set of developers.
Re:GNU Emacs conversion to Git
by davidgerard on Tuesday November 11, 2014 @07:28PM
(#8593234)
And, y'know, in short order he'll own the dive log market.
Eventually Mercurial ate Bazaar's pie and now Git is slowly eroding projects away from Mercurial. All hail Linus, who managed to create two open source systems that became de-facto industry standards.