![]() ![]() ![]() This is quite convenient if you have a commit-message policy, as it greatly increases the chances of the policy being followed. When commit.template is set, Git simply uses the content of the template file as a starting point for all commit messages. Step 5 : We can now edit the message according to our commit and save to complete the commit. This will bring up our preferred editor with the commit message template preloaded: git commit Step 4 : Now, we can try to change a file, add it, and create a commit. Step 3 : To let Git know about our new commit message template, we can set the configuration variable commit.template to point at the file we just created with that template we'll do it globally so it is applicable to all our repositories: git config -global commit.template $HOME/.gitcommitmsg.txt ![]() The filename isn't fixed and you can choose a filename of your liking. Save the commit message template in $HOME/.gitcommitmsg.txt. Implements-Requirement: Enter requirement-id or delete line Longer explanation of the motivation for the change Step 2 : We'll use the following command as a commit message template for commit messages: Short description of commit Step 1 : we will use the example repository from this post git clone The template is only for the local user and not distributed with the repository in general. We will see how to create a template commit message that will be displayed in the editor when creating a commit. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |