troubleshooting Question

Gitkraken repo, failing to checkout branch, then suddenly deleting dozens of files

Avatar of Matt K
Matt K asked on
Programming Languages-OtherProgrammingGit
4 Comments1 Solution345 ViewsLast Modified:
As will soon become clear, I'm not a master of Git or even Gitkraken. As such, I just have a hotfix, a master and a feature branch. I make changes in hotfix, commit, push, and merge into master (which I then also push). So far I've endeavored not to get more complicated than this.

Even my one feature branch is a bit cowardly, in that that I still keep my feature work separate (in separate files/directories) from my working files, and consistently merge master into the feature branch so I don't lose all the site's hotfixes – all so that my crucial site files are kept whole and untouched regardless of branch. I consider this an intermediate practice as I continue to maintain the site while getting my head around Git. Since now I'm having this bizarre issue, I can see why I hadn't taken that leap yet. Apparently I'm indeed not ready to power-use Git or Gitkraken.

This morning, I did some work on hotfix, and merged it into master. No issue. Then I tried to switch to the feature branch (which I hadn't been in for weeks as it has been all about hot fixes lately), and all hell broke loose. Gitkraken throws the error: "Checkout failed. Could not remove [swf file - one that was there long before my last commit] Operation not permitted." What? Web searches with these key phrases turned up literally nothing... making me the first person to have this happen, I guess.

Then!... immediately, still in hotfix and having done nothing further, suddenly there are 27 file changes staged and ready to commit! All of them deleted files, and none of which did I actually throw away. Some of them I didn't even touch since my last commit, others were new files I had made.

I was able to simply undo-button my way back and restore those deleted files, but this did inexplicable things to the Gitkraken timeline (see https://postimg.cc/ppw9zFNn) that I have no way of understanding... somehow it involves changes having been made to the feature branch (aka JQMUpdates5 in the screen cap) that I was unable to switch to...?

At least I got those deleted files back. However, I'm unable to move forward or to restore my repo to a workable state. Even after restoring to this morning's state via Time Machine, and attempting to retry the process, I get the same result.

The only thing I can think of is that the file GK "could not remove" is locked in the Finder. This shouldn't be an issue since this file is the same as many others like it in the repo – all of which are also locked n the Finder.

Other than that, it occurs to me I did not push master before trying to switch to feature – like I usually do. But as far as my meager understanding goes, it shouldn't be necessary to update the remote master branch before switching to a different local branch...

I need help. Is this a bug? Is my repo corrupted? The upshot seems to be that although I personally didn't delete any files, GK seems to randomly be doing it for me when I try (unsuccessfully) to switch to the JQMUpdates5 (feature) branch.

I'm trying to understand why my hotfix branch was in a fully up-to-date state until trying to switch to the feature branch, when suddenly GK trashes dozens of files and stages these deletions in one fell swoop. Undoing isn't helpful – just complicates the issue – and now I'm so spun around I have no clue how to get my repo back. It would be an absolute disaster for me to lose JQMUpdates5 branch, as it contains a huge amount of dev work.

I'm not sure how helpful my description of the problem is (because this is confusing as anything I've encountered), but I'd sure appreciate some guidance if anyone has any insight.
Gitkraken's inexplicable error messageThis happens immediately after the failed feature-branch-switch. This recurs even after restoring from everything from a time machine backup.This is the timeline after trying to undo the commits/pushes. I have no idea what's happening, but it seems to involve the branch I couldn't switch to, which is weird.
ASKER CERTIFIED SOLUTION
Matt KWeb Designer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros