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.