diff --git a/git/foundations_git/commit_messages.md b/git/foundations_git/commit_messages.md index 3dd7fcb83de..67c759c953b 100644 --- a/git/foundations_git/commit_messages.md +++ b/git/foundations_git/commit_messages.md @@ -68,6 +68,12 @@ Ahh, that's better! :) Now, developers can gain a better understanding of this c - Contains a body that provides a concise yet clear description of why the commit needed to be made (e.g., "Screen readers won't read the images to users with disabilities without this information"). - Separates the subject from the body with a new/blank line. This is a best practice we highly recommend following. It makes commit messages easier for other developers to read. +### How to commit with a subject and body in the message + +Up until now, you've been told to commit with `git commit -m `. To make a commit with subject and body in message, the simplest way is to type `git commit` without the `-m` flag and message argument. + +Doing so will open a new Visual Studio Code tab if you had [set Visual Studio Code as the Git editor](https://www.theodinproject.com/lessons/foundations-git-basics#changing-the-git-commit-message-editor). You can remove any comments and enter your multi-line messages. When you save and close the tab, your commit will be created. + ### When to commit A good way to view a commit is like a “snapshot” of your code at the moment that it was made. That version of your code up to that point will be saved for you to revert back to or look back at. @@ -93,11 +99,6 @@ There will come a time when you are working on a project and you FINALLY get som - Avoid using vague commit messages such as "saved" or "updated". - Commit early and often! -#### How to commit with a subject and body in the message - -Up until now, you've been told to commit with `git commit -m `. To make a commit with subject and body in message, the simplest way is to type `git commit` without the `-m` flag and message argument. -Doing so will open a new Visual Studio Code tab if you had [set Visual Studio Code as the Git editor](https://www.theodinproject.com/lessons/foundations-git-basics#changing-the-git-commit-message-editor). You can remove any comments and enter your multi-line messages. When you save and close the tab, your commit will be created. - ### Knowledge check The following questions are an opportunity to reflect on key topics in this lesson. If you can't answer a question, click on it to review the material, but keep in mind you are not expected to memorize or master this knowledge.