0

I working in a project where each commit in a branch MUST start with

Story PRJCT-NAME-42 Task description

And must contain a message like this

Story PRJCT-NAME-42 Task description

foo bar description

I've created a custom message and stored in ~./gitmessage. The content of the file is

Story PRJCT-NAME-42 Task description

It is possible t run git commit and have focus in line number three?

sensorario
  • 20,262
  • 30
  • 97
  • 159

1 Answers1

0

Add this line to your ~/.vimrc:

autocmd BufNewFile,BufRead COMMIT_EDITMSG :3

This will move the cursor to line #3 whenever a file called COMMIT_EDITMSG is opened (which is the name of the temporary file used by git while editing a commit message)

Jay
  • 3,640
  • 12
  • 17