Git is a git

git /ɡɪt/>
noun BRITISH informal
an unpleasant or contemptible person.
usage: "that mean old git"

This morning my internet stalled while I was deploying a website, which included switching a branch. Not thinking this would be an issue, after I resolved my internet connection I continued in this branch as per usual.

However after trying to publish later, it was evident that my changes were now not publishing despite using the exact same commands, and instead did something strange due to the contents of the scripts I was given for updating this website. It seemed like my local copy was now tracking to the current branch rather than master.

I tried the following to switch back to the master branch.

$ git checkout master

However this issue appeared:

$ git checkout master
derror: Your local changes to the following files would be overwritten by checkout:
    [redacted local addresses]

Running the following wasn’t promising either since I didn’t understand the entirety of the system setup due to it not being transparent enough, but the command continued on to listed almost all the pages I’d worked on in the past few months.

$ git status
$ git status
On branch [branch name]
Changes not staged for commit:
  (use "git add ..." to update what will be committed)
  (use "git checkout -- ..." to discard changes in working directory)
    modified:  [redacted list of local files]

This was not great, because not only did I want to lose the work from the previous months, I also had some 30 pages of new content I didn’t want to lose plus more on the list besides.

I read somewhere to try git-stash, but not knowing how that works and trying to avoid further destruction, I decided to make a backup of all the work that I’d done and opt for a merge, like so:

$ git checkout master -m
M   [redacted local address]
A     [redacted local address]
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.

So I was back to master finally, but were some pages impacted?

 $ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Unmerged paths:
  (use "git reset HEAD ..." to unstage)
  (use "git add/rm ..." as appropriate to mark resolution)

    both modified:   [redacted local address]
    deleted by us:   [redacted local address]

Untracked files:
  (use "git add ..." to include in what will be committed)


no changes added to commit (use "git add" and/or "git commit -a")

Good thing I’d created a backup… We’ll see what the long-term implications of this will be in coming weeks.


So apart from a removed folder of images, it seems there were no long-term harmful effects of the merge. With the backup, I could simply copy those files back across. Regardless, this continues to further highlight either my own inept-ness or a system that is not friendly enough to its users.