There&#x27;s a way to embed arbitrary garbage invisibly inside git commit objects. Just put your garbage after a NUL and nothing will display it as part of the commit message. Using that to generate two commit objects that collide is the most likely attack method.<p>Exploiting the result will involve some social engineering. Starting with getting one of the colliding objects accepted into the repo you want to attack.<p>At this point, it&#x27;s cheaper to generate a SHA1 collision than it will be to fix git not to use SHA1. Which is deeply worrying.<p>Basic hygiene at this point probably includes only merging git commits from others that are gpg signed (as well as gpg signing as many commits yourself as you can without going mad at the password prompts). Unfortunately, tooling doesn&#x27;t make this easy, and some things like git format-patch are actively unhelpful by not preserving gpg signatures.