1

For my job I need to do a git rebase of my feature branch onto the development branch.

These are my commands thus far to prepare the rebase:

git checkout feature-branch git rebase development # resolve conflicts in Visual Studio git rebase --continue 

After this, I'm getting the following in the cmd:

git rebase stuck in shell after conflict

Now it's just as if I'm typing a novel in Notepad. Hitting enter, ctrl + C, ... doesn't do anything.

I've already read other questions like this one but this doesn't offer me a clue of how to complete the rebase / exit the shell.

So how do I finish this rebase operation? What buttons do I need to press?

6
  • try esc, then i, type your commit message, then when done esc, :wq then enter Commented Feb 9, 2022 at 10:42
  • (this looks like you're using the vi editor, if you're familiar with that) Commented Feb 9, 2022 at 10:43
  • Thanks. It seems that this gets me back to the "merge conflict" state which I resolved earlier on. Visual Studio git indicates "Detached at xxxxxx" Commented Feb 9, 2022 at 10:46
  • Ah after resolving once more, and running git rebase --continue, exiting with the keycodes you provided, I'm again on my branch. Then I had to pull the remote commits that weren't mine, and finally I could push my feature branch. I do have some notions of vim, but never used it myself, always bash. But I would never have come up with these keycodes. Can you post this as an answer? Commented Feb 9, 2022 at 10:53
  • (Wondering if there's a nano equivalent too, I'm more used to that 🤣🤣) Commented Feb 28, 2023 at 16:13

2 Answers 2

4

It looks like you've been dropped into the vim editor, and currently in replace mode. You can get out of that by just hitting esc. Then you can type i to enter insert mode (which will probably behave more as you'd expect). Type your commit message, then hit esc again (back to command mode), then :wq (write-quit) and enter, and you're done.

Sign up to request clarification or add additional context in comments.

Comments

2

I don't have enough rep to post a comment, but as a side note it's possible to configure Git to use a different editor, for example git config --global core.editor "code --wait" would change the default to be VS Code

more information on this answer https://stackoverflow.com/a/36644561/18039381

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.