问题
When using git rebase -i with core.editor=gvim, the message "Successfully rebased and updated refs/heads/master." appears immediately, before I actually save the file that allows me to pick/reword/squash... commits. And gvim pops up with a message that the file is no longer available.
Is this a config issue on my end, or does setting core.editor to graphical vim just not work?
回答1:
When gVim is running in GUI (as opposed to inside the terminal), they will typically launch themselves in the background, so you can continue to work in the terminal after they are launched. This behaviour is normal when Vim is launched through its gvim shortcut. To disable it, use the -f option that forces Vim to stay in foreground, and not relinquish control back to the calling process until it is finished.
core.editor="gvim -f"
来源:https://stackoverflow.com/questions/43383123/git-rebase-i-with-gvim-doesnt-wait-for-me-to-save