Staging Git Commits within Vim | Vim 🔥 Tips and Tricks

preview_player
Показать описание
This is my workflow for staging Git commits all within Vim. I can pick which files, even specifically which changes, to stage. I can then create a commit with a custom message and then push it all up to the remote repository. All powered by vim-figitive, the Git wrapper for Vim created by Tim Pope.

References:

#Vim #Git
Рекомендации по теме
Комментарии
Автор

I use this plugin daily, but you taught me something new about it. Thank you!

khanriza
Автор

Adding a patch is easier using 'dd' on the filename. This opens a side-by-side diff of index/staging area file (left window) and the working file (right window). You can then then use :diffput (mapping dp) and :diffget (mapping do) to copy lines into the left window. When you :write the left window, it then appears in the Staged file area.
You can display the status window by type :G in the command area.

davidwillming
Автор

You can also use `-` to push individual commits, or - if you're on the "Unpushed to origin/master" line - push all the pending ones. Fugitive is such an astonishing plugin!

AndreaSchiavini
Автор

Thanks for the video! What vim color scheme are you using btw?

Skyler
Автор

What does the second colon in ":Ge:" do?

Edit: nvm, I figured it out - ":" refers to the fugitive-summary buffer (found it in :h fugitive-object)

Edit 2: ":Git" or just ":G" opens the status in a new window. Great plug-in!

rdd
Автор

How did you open fugitive and the buffer doesn't split?

admiralrodney