2

I am trying to commit using :Gcommit. A split window appears. I think I am supposed to enter the commit message there. However, when I press "i" to enter the insert mode, the buffer changes and I see lines, which are looking like the follwing one.

100644 f4ae5fb126cf3316410e05d113802464791b3813 0   filename

When I press "i" again, I am back to the window where I would like to enter the commit message.

Question: How do I enter the insert mode in this situation in order to enter the commit message?

(I am using vim-fugitive commit d854197c03c0b027cca41abf86a5557c5473b82f.)

skew41
  • 41
  • 2

2 Answers2

3

I had the same issue. Simply put, you want:

:Gcommit -a

Like me, you probably always skip staging individual files when you enter your commits and simply commit all changes at once with the command:

$ git commit -a

That's why using

:Gcommit 

alone isn't working as expected.

user3751385
  • 3,752
  • 2
  • 24
  • 24
2

This is not the window where you type your commit message. Since you have not staged anything, fugitive calls :Gstatus instead to show the index. Typing i in this window brings you to another view of the index. You should type i again to go back to the standard view, - to add files to the index, then commit with :Gcommit (then you will be able to type your commit message).

These commands are documented in :help fugitive-:Gcommit and :help fugitive-:Gstatus.

François
  • 7,988
  • 2
  • 21
  • 17
  • [Vimcasts](http://vimcasts.org/) episodes: [The Fugitive Series - a retrospective](http://vimcasts.org/blog/2011/05/the-fugitive-series/) – Peter Rincker Dec 03 '15 at 23:05