Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maximum commit message size

Tags:

git

Is there any size limit to the Git commit message? I searched trough the web but cannot find any relevant mention about this except this one.

However, that one does not answer my question.

like image 695
Juraj Martinka Avatar asked Mar 16 '12 08:03

Juraj Martinka


People also ask

Is there a limit to git commit messages?

The maximum lengths of the subject and message body can be configured in the standard Gerrit config file gerrit. config . The defaults are 50 characters for the summary and 72 characters for the description, as recommended by the git tutorial and expanded upon by Tim Pope.

How long should commit messages be?

Short (72 chars or less) summary More detailed explanatory text. Wrap it to 72 characters. The blank line separating the summary from the body is critical (unless you omit the body entirely).

How many characters can be in a git commit?

The 72-character limit This git commit message guideline means you have to concertedly add a carriage return when the body of your commit message approaches 72 characters.

What is the commit message in git?

A commit in GitHub is described as a saved change. A commit message explains what change you made to your project. It is greatly important to learn how to make a good commit message no matter if it is a personal or professional project.


1 Answers

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
like image 101
huon Avatar answered Sep 22 '22 08:09

huon