Liam Hardy
Liam Hardy

Reputation: 155

A few questions about github

I have just started using github and wanted to ask a few questions about it, instead of posting like 5 individual questions.

Question 1. How can I commit without a message or description? It seems the commit button is disabled when the text box is empty.

Question 2. How do I change the user I commit as? I have changed it by clicking "options" in github for desktop and changing my name there, but it is still using the old name.

Question 3. Why is the image of the commiting user not the same profile picture as my github account? its a different gravatar.

Upvotes: 0

Views: 67

Answers (1)

Dan Lowe
Dan Lowe

Reputation: 56518

The reason the commit message can't be empty is two-fold:

  1. You're not allowed because you're not allowed. An empty commit message doesn't tell anybody anything about why the commit happened, so git doesn't permit them.

  2. The commit message is one of the components that gets hashed in order to generate the commit's SHA1 commit ID.

The hash is generated from all of the following:

  • source tree of the commit
  • ID(s) of parent commit(s)
  • author info
  • committer info (may or may not differ from author info)
  • commit message
  • the label "commit" and a byte-count of all the above
  • the GPG signature of the commit (if present)

Upvotes: 1

Related Questions