0

I had 2 commits on the same branch which I wanted to squash into one. Upon googling I came across the following: rebase to squash multiple commits on same branch

Using the above-mentioned solutions I got the following window: enter image description here

Now the problem is I cannot type in anything in this window. How should I proceed with squashing the commits??

phougatv
  • 881
  • 2
  • 12
  • 29
  • 4
    Welcome to vim :) You probably want to [configure git to use another editor](https://stackoverflow.com/questions/2596805/how-do-i-make-git-use-the-editor-of-my-choice-for-editing-commit-messages). – Thomas Aug 25 '22 at 11:57
  • 2
    To get out and abort your rebase, type `:cquit`. – Thomas Aug 25 '22 at 11:57
  • Thanks @Thomas for the link and command. But I am not able to type or paste on that specific window, including the command you just provided. I am able to write at the very bottom of the window, but upon pressing enter (after typing in the command), it keeps adding a new line. – phougatv Aug 25 '22 at 12:01
  • Hm, weird. Then just close the window, I guess :) – Thomas Aug 25 '22 at 12:02
  • If you want to move ahead of this window, see - [Vim for Windows - What do I type to save and exit from a file?](https://stackoverflow.com/questions/4708645/vim-for-windows-what-do-i-type-to-save-and-exit-from-a-file#answer-4708659) and [How do I exit Vim?](https://stackoverflow.com/questions/11828270/how-do-i-exit-vim#answer-11828573). – phougatv Aug 25 '22 at 12:23
  • 2
    Don't just configure git to use a different editor, configure your environment so all sane tools use your preferred editor. Add `export EDITOR=your-preferred-editor` to your startup files. (eg `echo export EDITOR=nano >> ~/.bashrc`) – William Pursell Aug 25 '22 at 12:33
  • 2
    pressing escape should get you out of insert action and :q will let you exit the rebase command. – Harish Barma Aug 25 '22 at 13:29

0 Answers0