Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git rebase --continue opens editor

Tags:

git

git-rebase

After a rebase failed with a conflict, I could not continue the rebase using a Git GUI client. When performing

git rebase --continue

on command line (msysgit 1.7.4), it opened a text editor. After having closed it, Git continued. How can opening the editor be avoided?

like image 824
Mot Avatar asked Mar 15 '11 15:03

Mot


2 Answers

When a rebase fails, you have to manually fix the file and then exec git add filename to signal that everything is OK. At this point, git rebase --continue will continue the procedure without bothering you.

To change the default editor git uses issue: git config --global core.editor new_editor

Commands such as commit and tag that lets you edit messages by launching an editor uses the value of this variable when it is set, and the environment variable GIT_EDITOR is not set. See git-var(1).

like image 116
karlphillip Avatar answered Oct 03 '22 12:10

karlphillip


When a rebase incurs in conflicts, the user may need to make notable changes for resolving the them. Git assumes that the user wishes to modify the commit message, commenting on the conflict resolution.

This is documented in the paragraph Commit Rewording of the git rebase man page.

A way to prevent the editor from being opened, and to confirm the original commit message is the following:

$ GIT_EDITOR=true git rebase --continue
like image 27
Arialdo Martini Avatar answered Oct 03 '22 12:10

Arialdo Martini