Git (Gitkraken) spontaneously showing changed files when I made no changes

Viewed 820

I'm not much good with Git, and I'm still using Dreamweaver, if that tells you anything about where I'm at.

I have two website branches, one for normal operations (which is currently on ice, but must be updated from time to time to keep up with changes) and one for a truncated COVID version.

I switch from the COVID branch to the Hotfix branch (normal ops), make a change to a single file (not in Dreamweaver, but to a PDF), and duck back in to Gitkraken, only to find one of several things:

A) Gitkraken shows a hundred or so changes on the Hotfix branch that I most certainly didn't make, and they appear to be changes that were made on the COVID branch months ago. This doesn't happen with all files, just 80-100 (no rhyme or reason as to which ones). I can't figure how these changes seem to be "leaking" from one branch to another while I'm simply making changes to a single PDF.

OR

B) Gitkraken shows dozens of new files that are numerated duplicates of existing files ("file.html" is duplicated, and a new file is showing in the repo branch called "file 2.html") Again here, this isn't all files, only a couple dozen (sometimes more).

In either case I end up abandoning the branch and creating a new one from the last time I saw Hotfix behaving as expected.

It's been doing the latter (B) for a while now, but since it was only really a nuisance (I can delete a few duplicate files) I've been mostly ignoring it.

However, the "leaking" changes has the potential to be crippling and to destroy my hotfix branch, and my ability to go back cleanly to the normal ops version when this stuff all ends. I keep dreading looking at the repo and seeing a hundred or more file changes in there I didn't make. This "leaking" has only started happening this morning, far as I can tell, but I've already had to abandon two new branches. If I end up doing this again, it will meet the definition of insanity.

Now I just ducked back into Gitkraken after a system restart, (with Dreamweaver still closed so I can take it out of the equation) and now my COVID branch is showing the same behavior in reverse! 98 Changes from Hotfix are now showing in COVID branch.

I'm beside myself. Does anyone have any suggestions as to what might be causing this? Corruption? User error?

2 Answers

You mentioned your repo is placed in a directory synced with iCloud : this is definitely the cause of your troubles.

You can :

  • Work with a repo cloned somewhere else
  • Turn off the sync while you work
  • If possible : set your local client to upload changes from this directory but never download them automatically

As with all mysteries such as these, it is best to narrow the tree of possibilities with a sort of binary search, as it were.

Here are some starting point (and if you're lucky, ending point) tests to eliminate whole branches from the tree:

  • Boot your Mac in safe mode.

    • If the problem disappears, follow the steps under If the issue doesn't continue in safe mode at the provided link.
    • If it is NOT gone, I would hold off on OS reinstall for now. It's recommended by the If the issue continues in safe mode section, and you may eventually have to do it, but I'd exhaust other possibilities first (e.g the stuff below).
  • Make a fresh clone in a different folder and do your work there. This will tell us whether or not the problem is specific to that repo.

  • Make two fresh clones in different folders, one dedicated to each branch. After cloning and switching to the branch for which that clone is dedicated, DO NOT switch again. Given your described workflow I think this is possible... You sync changes between the repos via the central server.

    This should eliminate the your problem (A). If it does, it means you are probably doing something funky when switching or manipulating branches.

  • Disable Dreamweaver's git integration. If it was enabled, and the problem goes away with it off, it has to do with that integration or how you are using it.

  • Stop using GitKraken for now. Either use Dreamweaver's git integration, or learn to use the command line. The latter is not that hard, especially if, as it sounds like, you are not doing complicated things in git.

I can come up with more but let's start with these.

Related