5

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?

Halfacre
  • 565
  • 8
  • 26
  • Okay, well to quell some of my dread from the "crippling" factor, I discovered I can pretty quickly go through and discard these leaking changes one by one. Seems to have done the trick in the short term. Keeping an eye on it. – Halfacre May 07 '20 at 19:13
  • does this happen with just this repository? can you recreate this behavior in a brand new repository (with or without dreamweaver)? – MoralCode May 14 '20 at 19:42
  • Trouble is that the behavior is so sporadic... it can be days before I see it occur (and worse, it only happens when I'm not looking). In fact, the first time was when I posted this question, and the second time was today – a week later. Since this is my only real working repo, I haven't been able to compare it to others. I've created an empty repo with two branches, but so far, nothing. – Halfacre May 14 '20 at 23:10
  • I actually had a Git guy look at this today, and he too is flummoxed. He figures the duplication and the leaks are likely related, and rightly surmised that it couldn't be Dreamweaver or MacOS doing this, because neither system labels duplicate files with a "2" at the end (they use variants of "copy"). He thinks there must be some script in play, but I for dang sure didn't create such a script. – Halfacre May 14 '20 at 23:16
  • have you tried using a different git client? i'm quite partial to sublime merge but whatever you pick, it may help rule out a gitkraken bug (either that or maybe reinstall/update gitkraken from their official site) – MoralCode May 15 '20 at 00:53
  • can you describe the actions you take to "switch from the COVID branch to the Hotfix branch" ? what programs do you use (command line, gitkraken, some ide ...) and what actions you take with these programs ? – LeGEC May 18 '20 at 15:22
  • Use Gitkraken pretty much exclusively for this repo. Have two specific branches that I'm maintaining currently, one for normal ops (hotfix) and a scaled back version (covid). I make a small text change on covid, commit and push. Double click on hotfix to switch branch. Don't even have to make a change in hotfix –˜either way, double click covid again, make no further changes, yet changes start showing up in the panel. Today, I caught it in the act, 10 min after I made a change, not even touching keyboard, suddenly 15 changes pop up – the changes are from the other branch (hotfix). – Halfacre May 18 '20 at 22:06
  • I have sourcetree open to see what happens there. If it happens with GK open, I'll close GK see what Sourcetree does on its own. This is hard to track because it's so sporadic. – Halfacre May 18 '20 at 22:08
  • Oh, and my GK is fully up to date. Their support crew assures me that GK cannot make changes, which certainly makes sense. Still, I agree its a good idea to rule it out completely. – Halfacre May 18 '20 at 22:11
  • git alone won't change your content on disk. Do you know of an automated task that would check something in your repo ? a git hook, a cron job, some script triggered by your ide ... – LeGEC May 19 '20 at 06:21
  • No, I know of none of those things being in play, and I've been maintaining this repo alone for years - never seen anything like this. I I've cut the IDE out of the picture, as I've had this happen when DW is not open. – Halfacre May 19 '20 at 16:27
  • It only seems to happen shortly *after* (but not immediately after) I make a change on either branch. Sadly, every time it happens I take the chance on degrading the quality of whatever branch I switch to, as I pick through and discard changes I don't want. – Halfacre May 19 '20 at 16:31
  • Is your repo on a local regular filesystem ? or is it on some shared folder / shared server ? – LeGEC May 19 '20 at 16:58
  • @LeGEC - good question. It's on my iCloud drive, but I'm the only user. It's been there for some time. Could that be a problem? – Halfacre May 19 '20 at 18:39
  • With an active iCloud client ? Definitely. The syncing strategy may very well choose to download the last synced files. – LeGEC May 19 '20 at 18:43
  • Well yikes. I haven't run into any issues till this past week, and it's been up there for years – maybe because I had enough HD space. But that certainly makes sense now that you mention it. Cloning the repo to my drive presently. – Halfacre May 19 '20 at 19:48

2 Answers2

3

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
LeGEC
  • 46,477
  • 5
  • 57
  • 104
  • Okay, cloned the repo into my (unsynced) Documents folder, switched over to it and have done a few commits/pulls/branch switches. So far this is the GitKraken I've grown accustomed to. I guess this is a forehead slapper for me... can't believe I didn't run up against this earlier, but looking around it seems others had similar experiences – everything was fine until it wasn't. – Halfacre May 19 '20 at 20:21
  • I'm going to give it a couple hours to make sure nothing weird happens, but I think have a winner. Thanks, @LeGEC! – Halfacre May 19 '20 at 20:23
1

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.

Inigo
  • 12,186
  • 5
  • 41
  • 70
  • Great, Inigo - thanks. Working in safe mode for now, and haven't seen the behavior return yet with tests over the past half hour (and I *was* able to recreate it earlier using the same test, so good sign...?). Gonna keep an eye on it for a bit. Hopefully just the safe boot/reboot will put this to bed. If not, I'll try a fresh clone and go from there. – Halfacre May 19 '20 at 18:36
  • If the problem *does* go away in safe mode, be sure and do all the things I recommended under that bullet. – Inigo May 19 '20 at 18:49