2014-12-07 236 views

回答

27

有幾種方法可以完成這項任務。我將概述使用:Gstatus的最具交互性的方法。

  • 通過-
  • 開始通過<c-n>/<c-p>
  • 舞臺/ unstage文件打開通過:Gstatus
  • 文件之間移動的狀態窗口提交通過cc而在狀態窗口
  • 創建提交信息並保存並關閉窗口。 (我喜歡:x
  • 您還可以使用zjzk到部分
  • 上一節使用-將上演/ unstage在該節

所有文件之間移動如需更多幫助,:Gstatus看到:h :Gstatusg?當在:Gstatus緩衝區。

可以使用:Gwrite:windo跳過:Gstatus窗口,使其更快一點。

:windo Gw 
:Gcommit 

您還可以使用-m標誌跳過整個提交窗口。例如:Gcommit -m "A short message"

我建議對逃犯Vimcasts視頻:The Fugitive Series - a retrospective

要了解更多信息請參閱:

:h fugitive 
:h :Gstatus 
:h :Gw 
:h :Gcommit 
:h :windo 
:h :x 
1

無逃犯:

:windo !git add % 
:!git commit -m "My message goes here" 

的最後一個命令可以被替換

:!git commit --interactive