0

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.

Liam Hardy
  • 155
  • 4
  • 13
  • 3
    1) Easy: You don't write empty commit messages. Commits have messages for a reason! 2) Why/What for do you rant to change that? Please explain further what you intend to achieve. 3) Your commits are probably not "marked" with the exact same email address as the one you're using as login. http://stackoverflow.com/q/10638062/1116364 – Daniel Jour Oct 28 '15 at 23:56
  • 1) Okay, 2) I want to change it because I misspelled it and forgot how I changed it in the first place. 3) Yes, they are in my options in github4desktop it has the same email i use on the website (primary) – Liam Hardy Oct 28 '15 at 23:59

1 Answers1

1

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)
Dan Lowe
  • 51,713
  • 20
  • 123
  • 112