2

Possible Duplicate:
Start a git commit message with a hashmark (#)

I have something to do with my latest commit as I have to give a hashmark as the starting line for all my commit message

for example :
- #fix email : send something useful
- #dev html-email : create cross platform layout

but accidentally I forgot the hashmark, I wrote
- fix html-email : fix layout for outlook
(notice the missing hashmark)

and I did
- git reset --soft HEAD^
- git commit -c ORIG_HEAD

but everytime I put hashmark on the firstline, the vim will ignore it.
- I've tried using '\' , but the backslash character was printed in the commit message.
- I also tried using 'space' , and the whitespace appear before the first character of my commit message.

Q : how do I put hashmark (#) as the starting line in my commit message using vim, so it wont be ignored ?

note :
I'm using git-bash for windows.

Community
  • 1
  • 1
mdennisa
  • 177
  • 2
  • 13
  • 3
    This question has been answered in this other question: http://stackoverflow.com/questions/2788092/start-a-git-commit-message-with-a-hashmark – phiggy Dec 12 '11 at 04:52
  • 1
    BTW, Using `git commit --amend` is identical to your two commands `git reset --soft HEAD^; git commit -c HEAD@{1}` (not `ORIG_HEAD`, that's something else), except it's simpler. – Lily Ballard Dec 12 '11 at 05:00
  • It's possible to work around this but... why? *Requiring* the one comment character in commit messages is asking for all kinds of pain. – Cascabel Dec 12 '11 at 05:44
  • @phiggy yes of course I checked out that question, I'm asking whether I can solve this thing out directly with VIM ? – mdennisa Dec 13 '11 at 03:46

1 Answers1

2

You can do:

$ git commit --cleanup verbatim

to prevent any cleanup of the file. (No lines will be removed.)

William Pursell
  • 204,365
  • 48
  • 270
  • 300