vscode: Git: Can't rebase continue or commit without modified files

From @schollii

  1. While a branch is checked out, I do a git rebase master from command line (bash on ubuntu), and git hits a conflict.
  2. I then go to the vs code window where the folder is open. In the Git panel on the left, I can see the file listed under Merge with a C as status, and I can see there are conflict markers in the file.
  3. I resolve each conflict and save.
  4. The file status changes to M once all conflicts resolved.
  5. Then I can click the plus sign on the file, and the file disappears from the Merge (perhaps a commit occurs then?). But a rebase continuation does not happen, there is nothing under Commit, and there is no option to do rebase continue.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 25
  • Comments: 18 (8 by maintainers)

Most upvoted comments

I run into this issue several times. If I try to continue the rebase via terminal, it tells the following:

git rebase --continue
Applying: original commit message here
No changes - did you forget to use 'git add'?
If there is nothing left to stage, chances are that something else
already introduced the same changes; you might want to skip this patch.
Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".

If there are other changes than the conflicted files, VSCode can continue the rebase by just clicking commit. Here that doesn’t work.

The line that helped me was the following from the error log above:

You can instead skip this commit: run "git rebase --skip".

My workaround:

  • add the resolved conflicting files by clicking the +
  • run git rebase --skip in the terminal

Suggestion: So maybe a solution could be (analog to the rebase behavior) to tell VSCode to run git rebase --skip if there are no staged files in rebase in progress state when the user clicks commit.

@skprabhanjan referring to the issue I’ve opened yesterday (#60275 ), the steps are a bit different. When I accept the current changes (so the file is identical to the version of the last commit) and I click on “+” sign the file disappears from “Merge Changes” but doesn’t appear under “Staged Changes”.

Hope you find this useful, thanks in advance

Steps to verify:

  • Launch VS Code Insiders (2022-07-28 or later)
  • Open a folder/workspace that contains a git repository
  • Create a topic branch (ex: rebase-test)
  • Switch back to the main branch, make a change in a file, and commit
  • Switch to the topic branch, modify the same line in the same file, and commit
  • From the command palette execute the Git: Rebase Branch... command and choose the main branch
    • Confirm that you get a notification that there is a conflict that you have to resolve
  • Resolve the conflict by accepting all changes from the main branch
  • After resolving the conflict, save the file, and click on the + action to stage the change
    • Confirm that the file does not appear any more in the “Source Control” view
  • Click on the “Continue” action button
    • Confirm that the rebase operation completes

I run into this from time to time as well. Just this last time, I had to git rebase --skip all the commits locally. Then I click the button to pull/push to my remote which then introduced the same merge conflicts that I had during my first --skip locally. Resolved those and committed. Then my pull/push commit counts changed from 3/22 to 0/23. Clicked the button again to push all 23 back up to my remote. Very confusing process though.

Well, no… the staging it correct. Staging those files will end up in a no-op. The problem is that you can’t commit in VS Code without changes, although you’d want to continue the rebase/merge in this case. I will remove the help wanted label as this seems to be an advanced issue.

@joaomoreno , few points to just clear things I tried reproducing this taking the comments into consideration.( referring to all 3 issues that were opened before)

  1. git rebase master did throw an error in the bash saying merge conflict
  2. Went to the file and resolved the conflicts
  3. Clicked on the “+” sign to stage the changes and it did disappear from the “Merge Changes” and came under “Staged Changes” (This did not run the commit )
  4. Entered the commit message and committed the changes.

Until this point git rebase --continue was not run even though the rebase was in progress (Referring to https://github.com/Microsoft/vscode/issues/6614#issuecomment-415729755). Attaching the git log file for these operations. log.txt

So after the 4th point is when the git rebase --continue command should run?

Please clarify if I am in the correct path 😃 Thanks!

@joaomoreno , can i work on this? 😃

i still cannot continue the rebase wiht ui cause of empty commit. the old FR #6614 took 2 years, how long will it be this time