Maximum commit message size

Empirically, I think the answer is no. This worked (that’s a ~100MB commit message):

yes | head -c 100000000 | git commit -F - > /dev/null

Command parts explanation:

  • yes repeats "y\n" forever
  • head -c 100000000 takes only the first 100,000,000 bytes (~100MB)
  • git commit -F - commits with the passed-in commit message (this won’t work if you haven’t staged any changes to commit)
  • > /dev/null hides the output from the command, which includes Git repeating back the very long commit message

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)