1

I'm using a git commit template to standard my commits, but the commented lines (start with #) don't is erased after commit.

Can I configure the git gui to disregard theses lines? I use git gui as editor for commits.

I configure the the commit template using:

git config --global commit.template C:\Users\Name\.gitmessage

My .gitmessage file:

#<-------------( Title: 50 chars )-------------->#
# Title/Summary/Imperative/Captilized/No period

# remember blank line between title and body

#<-------------( Body: wrap it to about 72 chars or so )-------------->#
# Body: Explain *what* and *why* (not *how*). Include task ID (issue).
# Explain the problem that this commit is solving. Focus on why you
# are making this change as opposed to how (the code explains that).
# Are there side effects or other unintuitive consequences of this
# change? Here's the place to explain them.

# <blank line>

# Co-authored-by: name <user@email.com>

The idea is that all the lines of the template are not included in the commit, the lines that start with # are ignored.

EDIT:

Using the VS Code as the main editor works well.

$ git config --global core.editor "code --wait"

Arcaniaco
  • 400
  • 2
  • 10
  • 1
    Identical to https://stackoverflow.com/questions/41117061/git-gui-doesnt-ignore-lines-starting-with-a-hashmark-in-the-commit-message ? That question is unanswered, which sounds like this is a known issue. – matt May 02 '22 at 13:34

0 Answers0