Skip to content

Instantly share code, notes, and snippets.

@momo-lab
Last active November 26, 2016 16:44
Show Gist options
  • Save momo-lab/97e2603770843b1c91246e05e36d4537 to your computer and use it in GitHub Desktop.
Save momo-lab/97e2603770843b1c91246e05e36d4537 to your computer and use it in GitHub Desktop.
vim-fugitiveを使ってgit add -pする方法

fugitiveでgit add -pする

:Gdiffしてから、do dpでマージを行ってから:wqするとよい。

デフォルト?だと、左(or 上)がstage、右(or 下)がunstageの内容となるので、 左(or 上)側にマージして左(or 上)側で:wqすること。

do, dpだと塊全体がマージされてしまうので、選択範囲のみをマージしたいなら、

:'<,'>diffget
:'<,'>diffput

を使うとよい。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment