this is a question about VIM and not git itself (if i'm not mistaken)
VIM uses multiple modes, to exit insert mode hit ESC or ^C. to save and exit the file use ZZ
, :x
or :wq
just to be complete: git commit -a
will first add all tracked and changed files' contents to the index and then creates a commit (after specifying the commit message inside vim – or your editor of choice)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…