git-up / GitUp

The Git interface you've been missing all your life has finally arrived.
http://gitup.co
GNU General Public License v3.0
11.45k stars 1.24k forks source link

Rebase succeeds but working dir is left dirty and error “Local changes would be overwritten by checkout” pops up #910

Open ghost opened 1 year ago

ghost commented 1 year ago

I’m using 1.3.5 on an M1 Mac running MacOS 12.6.3.

This has happened for me multiple times over the past few weeks — I’m not sure exactly when it started — with multiple repos.

I’ll be working on a feature branch that has conflicts with main so I’ll want to rebase my feature branch on main.

Once I resolve the conflict, the rebase seems to succeed just fine, but an error message pops up: Local changes would be overwritten by checkout and when I dismiss that and switch to the Commit View, there’s a ton of files that seem to be changed — some staged, some not.

Here are some screenshots:

I start clean on my feature branch with no changes in the working dir:

Screen Shot 2023-01-25 at 20 55 15

I start the rebase, conflicts are reported:

Screen Shot 2023-01-25 at 20 55 32

I’ve resolved the conflicts:

Screen Shot 2023-01-25 at 20 55 50

I’ve just pressed Commit:

Screen Shot 2023-01-25 at 20 56 11

I dismiss the error, and the branch looks like it rebased as expected; it looks good:

Screen Shot 2023-01-25 at 20 56 28

I switch to Commit View and there are many unexpected changes in the wd:

Screen Shot 2023-01-25 at 20 56 48

I’ve found that I can just discard all of these changes without losing anything I need.

So, I can work around this, but it’s annoying and disconcerting.


I have no idea what’s going on here. Any chance I’m doing something wrong? Is there anything I could do to help debug this?

lucasderraugh commented 1 year ago

Potentially related to #882. If you have an easy repro case I can go through I'd like to debug it, but I haven't found resolving conflicts on merges or rebases to trigger an issue. I'm sure the issue exists, but having a reproducible way to hit it would be extremely helpful.

ghost commented 1 year ago

Thanks, I’ll see what I can do.

balavor commented 1 year ago

Got the same issue. Rebasing a branch where few commit have conflicts, after resolving the first commit, the whole operation gets canceled with the error, and all files are left in the repo as new.

soberman commented 1 year ago

Yep, I experience the same issue.

NikKovIos commented 1 year ago

@lucasderraugh the same thing with every merge. Steps:

1) Branch A from master. 2) master have changes. 3) Branch master merge into A. Conflicts occured. 4) After resolve conflicts and press merge the error occured. "Local changes would be overwritten by checkout"

DanielRouxSA commented 1 year ago

I'm encountering this issue with merging as well.

NikKovIos commented 10 months ago

Up. Very annoying (

balavor commented 10 months ago

Same thing for like a half year or more :(

mluisbrown commented 6 months ago

I also have the same issue for months, to the point where I only ever do rebases with the git CLI now 😞 Merges in GitUp are still ok though.

breathe commented 5 months ago

I'm having the same issue as well -- with some but not all rebase's

After unstaging and and discarding all the edits in the working directory -- I seem to be in the expected state ...

breathe commented 4 months ago

@lucasderraugh was anyone able to supply you with a repro scenario for this ?

lucasderraugh commented 4 months ago

@breathe Looks like there are many repro steps here. I haven't had the chance to debug it yet. Going to push out latest GitUp to the stable channel today and then I'll try to make the next release a focus on fixing up some of these libgit2 fallout changes.

balavor commented 3 months ago

@lucasderraugh a common way I can reproduce the issue is to rebase branch A on branch B, where branch A has 2 commits, and each of them requires resolving conflicts in the same file.

After resolving conflicts in a first commit, when it gets to the second one, the entire rebase fails with an error "Local changes would be overwritten by checkout". However, if you delete the last commit from A and perform the rebase again, the rebase will succeed, but it would also have an error displayed.