Git integration fails to see merged file as staged if I reject all incoming edits
VS Code Version 1.2.1 Commit fe7f407b95b7f78405846188259504b34ef72761 Date 2016-06-14T13:00:22.146Z Shell 0.37.6 Renderer 49.0.2623.75 Node 5.10.0 Windows 10 Enterprise x64, latest non-Insider git version 2.9.0.windows.1
Description: during a Git merge process, VSCode can sometimes show no pending changes and refuse to let me commit, while command-line Git believes a merge is in progress and lets me commit. This occurs if the changed file contains no changes (after merge) that came from the commit that I am merging into my local state.
Steps to Reproduce:
- Create Git repository (e.g. on GitHub).
- Clone to working folder A.
- In working folder A, commit a file with some arbitrary text. Commit and sync
- Clone to working folder B.
- In working folder B, change some part of the file. Commit and sync.
- In working folder A, change some part of the file, conflicting with previous. Commit and sync.
This will result in a merge conflict due to the change from working folder B getting pulled.
Resolve the conflict by removing all changes pulled form working folder B - the file should be the same as the committed state that existed in working folder A. Stage the file to mark the file as resolved.
Expected result: file is staged and VSCode lets you commit the merge.
Actual result: file disappears from Git tab and VSCode says cannot commit as there are no pending changes.
git commit from the command line works fine to finish the merge, only VSCode refuses to cooperate here.
This is a bit unfortunate and a not so common real world case. It happens when:
- There are no changes other than conflicting changes
- The conflict resolution for all changes is to take
Aversion
The command line git will create an empty commit, since there is nothing to be done on the merge commit. Code will just not let you do a commit since it doesn't support empty commits.
We should maybe make Code aware that a merge is in progress, thus allowing the completion of the merge to follow.
Related to #6403. Fix could be done regarding both.
Any update here?
#88034 is probably a duplicate.
I also recently came across this. I think it's not necessarily a rare thing for beginners who are experimenting with a simple repo and simple conflicts. It is very confusing with the way this just disappears in the UI even though the merge isn't complete.
A fix would be very helpful.
Fixed by adding an action to Create Empty Commit to the notification
@joaomoreno this totally works and is clearly a corner case, but its not the most intuitive notification. i wish I could see that I did something with the merge conflicts and create empty commit changes to something like "ignore all incoming merge conflicts". i imagine anything more custom is not trivial so I do not reopen this.