1

I am completely a noobie here and as well as on Github and its git bash commands.

I was about to change the commit message of a file using the git rebase -i HEAD~X command, and in rebase mode, I can't enter the command reword. How can I perform this? I'm using Git Bash 2.11.0 on Windows 7.

Humble Potato II
  • 161
  • 1
  • 1
  • 12

2 Answers2

1

Normally "git rebase -i" will open a text file for you to edit, where you can enter the different commands you need in front of each commit. Are you expecting a different behavior?

If you are not able to change the text in the file that opens, it is most likely because it is opened in the default text editor, which is vim.

You can change this to an editor of your choice using the command

git config --global core.editor "notepad"

To reset the editor setting to the default use

git config --global --unset core.editor
sp1nakr
  • 378
  • 2
  • 12
  • wow thanks for the answer! but how can I reset it to default? – Humble Potato II Dec 12 '16 at 06:31
  • Why would you reset it to the default value? It's a configuration setting, change it to suit your needs, as often you need, and forget about the default. Read more about [`git config`](https://git-scm.com/docs/git-config). – axiac Dec 12 '16 at 07:01
  • @HumblePotatoII I am not sure why you would want to do that, but you can "unset" the config. I updated my answer. – sp1nakr Dec 12 '16 at 07:48
0

I think you are not familiar with vim? when you type git rebase -i, you are in vim mode. You should enter i to enter interact mode which is writable. Here to learn vim tutorial. if you want quit, you shoud type :q!and press enter to return commond mode , and git rebase --abort to abort the rebase operation this time.

fan123199
  • 49
  • 5