What you're asking is, has anyone done a thorough professional test of the git cli for leaks and the answer is probably no they haven't so you can't be 100% conclusively sure it is "safe".
Of course, Linus Torvalds himself wrote Git and so it is open source. The source code can always be honest and you can reach out to the Tor community via the mailing lists or IRC chat to see if anyone has any doubts about it.
As a side note. If you signed up to Github, Gitlab, etc. without Tor, they already know your IP so then the point is moot. The only way to be 100% sure is to run your own Gitlab or other git-based service. As a matter of fact, The Tor Project is moving to their own internal gitlab instance instead of the old source control platform.