Explore Courses Blog Tutorials Interview Questions
+5 votes
in DevOps and Agile by (19.4k points)
edited by

I'm new to both git and GitHub. I managed to set up everything locally on my Mac so that now I can push commits to GitHub via git (on the command line, not the Mac app).

When I push commits directly from the GitHub web interface (e.g. quickly fixing a typo), I have the chance to "comment" the commit, and GitHub gives me a commit title and a commit description. I find this very useful.

Still, when I git push from the local machine, git opens my default editor: so I write the commit comment, and then GitHub automatically divides it into title and "body". Is there a way to pretty comment commits from terminal too?

1 Answer

+6 votes
by (27.5k points)
edited by

There is this command that can be used to commit a change with both “message” and “description” from the command line, 

$ git commit -m "Title" -m "Description .........."

For more information about installation of git and common git commands please go through the following link:


Git commit message-How to commit a change with both “message” and “description” from the command line?
by (29.3k points)
you can run git commit without any message then it will open a vim editor where you can describe a message about the commit.

Browse Categories