+3 votes
1 view
in Devops and Agile by (15.5k 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

+5 votes
by (20.6k points)

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 .........."

by (20.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.
...