Skip to content

Gitbutler wants to delete force delete files from repo #5651

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
andre-s8 opened this issue Nov 22, 2024 · 13 comments
Open

Gitbutler wants to delete force delete files from repo #5651

andre-s8 opened this issue Nov 22, 2024 · 13 comments
Labels
bug Something isn't working

Comments

@andre-s8
Copy link

Version

0.13.16 (20241121.082346)

Operating System

macOS

Distribution Method

dmg (Apple Silicon)

Describe the issue

Whenever I start up gitbutler, it want always want to delete 2 specific files I do not know why it wants to delete these files but its just 2 icon files.

How to reproduce

Screen.Recording.2024-11-22.at.13.26.48.mov

Expected behavior

The file should have been deleted in the first place

Relevant log output

No response

@andre-s8 andre-s8 added the bug Something isn't working label Nov 22, 2024
@Byron Byron added the feedback requested Feedback was requested to help resolve the issue label Nov 22, 2024
@Byron
Copy link
Collaborator

Byron commented Nov 22, 2024

Thanks a lot for reporting and for the video!

Discarding the files also doesn't work and I have a feeling that these files have been removed from the index and the working tree, and this is what it picks up. Then, when discarding files, it might just try to remove it from disk and that does nothing as the file isn't there in the first place.

Could you check with git status if these files indeed show up as deleted from the index?
The reason I am asking is that when trying this, it worked for me. However, during my tests I always saw the 'locked' symbol, which I don't see in the video - maybe that's related.

Thanks for your help.

Edit: Maybe you could start GitButler from the terminal as well using /Applications/GitButler.app/Contents/MacOS/gitbutler-tauri - that way logs are easily extractable in case errors show up.

@andre-s8
Copy link
Author

andre-s8 commented Nov 25, 2024

Hi @Byron thanks for helping me out. I tried to restore the files when I run git status it does appear.

However when I try to restore them it appears in my commit as deleted again.

image

@andre-s8
Copy link
Author

After delete this .git folder and initialising it again I am still getting this bug. its very weird.

@Byron Byron removed the feedback requested Feedback was requested to help resolve the issue label Nov 25, 2024
@Byron
Copy link
Collaborator

Byron commented Nov 25, 2024

It is very strange indeed.

Even if I locally remove a file from the worktree, and then discard that change in the GitButler UI, I have the expected effect as the file is restored, similar to what git restore <file> would do.

I thought for a moment that the files might be ignored, but when I do that the changes don't show up at all, I created #5662 for this.

Maybe these files have .gitattributes assigned to them that somehow have an effect on this?

@Byron Byron added the feedback requested Feedback was requested to help resolve the issue label Nov 25, 2024
@andre-s8
Copy link
Author

There is no git attributes for the files, I even tried manually cloning using gitbutler ui but it gives me the same story, it wants to delete the files, I didn't even start typing or anything.

image

@andre-s8
Copy link
Author

@Byron I do have logs I can provide, however I am wary to share them because it may contain organisational data.

@andre-s8
Copy link
Author

@Byron seems to be with the reset_files and reset_files:create_nsapshot handle:recalculate_everything or something.

@Byron
Copy link
Collaborator

Byron commented Nov 25, 2024

Thanks for taking a look! If ERROR shows up in the logs, that would definitely mean something.
Strangely, git status also shows them as deleted, because they are - at least this is what I understood from the picture.
And restoring them even with Git doesn't actually do anything, right?

If so, it's somewhat unrelated to GitButler it seems, but maybe the redacted version of ERROR messages can be shared here to shed some light.

@andre-s8
Copy link
Author

Restoring the files does does not help, gitbutler will mark them as deleted for some reason and would want to add it to the commit. the files do exists I have check the repo on our production branch and we do use them.

There no errors just INFO logs.

@Byron Byron removed the feedback requested Feedback was requested to help resolve the issue label Nov 25, 2024
@Byron
Copy link
Collaborator

Byron commented Nov 25, 2024

I see… unfortunately it remains a mystery what's happening here.

Only one more thing - could you confirm that git status also shows them as deleted? And after restoring them with Git, git status is clean?
If that's the case, it's the question how they get deleted again - right now it feels like going into GitButler is all it takes to get them deleted somehow.

@andre-s8 andre-s8 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 6, 2024
@nz-chris
Copy link

nz-chris commented May 7, 2025

Hi @Byron! I'm here because this just happened to me, too.
I just got back to work this morning, and noticed my config.toml file is gone. I couldn't find it in my macOS bin, and when I tried to recreate the file (e.g. using touch config.toml) it would automatically delete itself!

As soon as I quit GitButler, I could create the config.toml without it being deleted.

This is very scary to me as

  1. I'm not sure what else it deleted
  2. I'm not sure what else it might delete in the future, so I'm scared to use GitButler again now.

M2 Pro macOS 15.3.1 (24D70)
GitButlerVersion 0.14.19 (20250428.160452)

😬

@Byron Byron reopened this May 8, 2025
@Byron
Copy link
Collaborator

Byron commented May 8, 2025

Thanks for sharing this unpleasant experience and I am sorry you had to experience this - it is very, very scary :/.

Even though it's still unclear what is causing this, if you wanted to launch GitButler just one more time to type v3 then it will switch to the next major version which is basically a rewrite. I would expect it to not exhibit this behaviour.
Thank you 🙏.

@nz-chris
Copy link

nz-chris commented May 9, 2025

Update: I encountered an issue that caused me to love a lot more files by committing to the gitbutler/workspace branch outside of GitButler (bad idea in retrospect) and then re-opening GitButler and trying out v3...

@krlvi helped me out to get my files back and let me know that the v3 rollout and the following weeks of stabilizing the app will make this sort of issue a thing of the past. Thanks again!

To be safe, I personally will use GitButler again in a month or so. I'm confident I'll come back and not experience such an issue again :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants