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

Created on 8 Oct 2018  路  11Comments  路  Source: microsoft/vscode

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.
bug git

Most helpful comment

@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

All 11 comments

@joaomoreno , can i work on this? :)

@joaomoreno thank you for referencing my issue, I'm going to subscribe to this thread :)

@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!

@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

@matteobosc , I understand your point that the steps are different but I guess all these will be fixed under the same issue
@joaomoreno should confirm upon this :)

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 )

You gotta resolve the changes by taking all changes from one side, in order for the file not to end up in the Staged Changes at all.

@joaomoreno , I will try understanding this more deeply.
Will get back to you in case on any doubts :)
Thanks!

@joaomoreno , is this approach good ?
Should we include something similar to https://github.com/Microsoft/vscode/blob/master/extensions/git/src/repository.ts#L775 in this function (https://github.com/Microsoft/vscode/blob/master/extensions/git/src/repository.ts#L764) ?
Thanks !

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.

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.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

omidgolparvar picture omidgolparvar  路  3Comments

chrisdias picture chrisdias  路  3Comments

villiv picture villiv  路  3Comments

curtw picture curtw  路  3Comments

biij5698 picture biij5698  路  3Comments