# Potential git bug

3 messages from 2018-03-19 to 2018-03-19. Participants: Nick Hunt, Jeff King.
Thread: https://gitlist.dev/t/48090

## Nick Hunt, 2018-03-19 19:13

Subject: Potential git bug
Message-ID: <CAJ-HmiZFpGbe_kLUFoOibMgc2dtf=n5VXb=ReZjN2wNsja1Lrw@mail.gmail.com>
URL: https://gitlist.dev/e/CAJ-HmiZFpGbe_kLUFoOibMgc2dtf%3Dn5VXb%3DReZjN2wNsja1Lrw%40mail.gmail.com

```
i committed my changes, then ran
git reset --soft HEAD^
at this point everything is fine
then i switched branches, and all of my changes vaporized into thin
air. uhhh, is this supposed to happen?

anyway, thank god intellij saves my work for me as i go, so i didn't
have to re-write all my code.

my bash/zsh commands are attached.

thanks for the help! :)


 nhunt@nicks-mbp  ~/Turner/newstron_client/newstron/videoingest   master ●  gst
On branch master
Your branch is behind 'origin/master' by 50 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   ../cnn/services.js
	modified:   ../resources/vendor/quark-filters/.bower.json
	modified:   ../resources/vendor/quark-filters/README.md
	modified:   ../resources/vendor/quark-filters/dist/quark-filters.min.js
	modified:   ../resources/vendor/quark-filters/dist/quark-filters.min.js.map
	modified:   ../resources/vendor/quark-filters/src/quark-filters.js
	modified:   js/videomonitor-page.js

no changes added to commit (use "git add" and/or "git commit -a")
 nhunt@nicks-mbp  ~/Turner/newstron_client/newstron/videoingest   master ●  git add -u
 nhunt@nicks-mbp  ~/Turner/newstron_client/newstron/videoingest   master ✚  gst
On branch master
Your branch is behind 'origin/master' by 50 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)

Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	modified:   ../cnn/services.js
	modified:   ../resources/vendor/quark-filters/.bower.json
	modified:   ../resources/vendor/quark-filters/README.md
	modified:   ../resources/vendor/quark-filters/dist/quark-filters.min.js
	modified:   ../resources/vendor/quark-filters/dist/quark-filters.min.js.map
	modified:   ../resources/vendor/quark-filters/src/quark-filters.js
	modified:   js/videomonitor-page.js

 nhunt@nicks-mbp  ~/Turner/newstron_client/newstron/videoingest   master ✚  git reset -- ../cnn/services.js
Unstaged changes after reset:
M	cnn/services.js
 nhunt@nicks-mbp  ~/Turner/newstron_client/newstron/videoingest   master ●✚  gst
On branch master
Your branch is behind 'origin/master' by 50 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)

Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	modified:   ../resources/vendor/quark-filters/.bower.json
	modified:   ../resources/vendor/quark-filters/README.md
	modified:   ../resources/vendor/quark-filters/dist/quark-filters.min.js
	modified:   ../resources/vendor/quark-filters/dist/quark-filters.min.js.map
	modified:   ../resources/vendor/quark-filters/src/quark-filters.js
	modified:   js/videomonitor-page.js

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   ../cnn/services.js

 nhunt@nicks-mbp  ~/Turner/newstron_client/newstron/videoingest   master ●✚  git commit -m "MCI-515: initial commit: speeding up load time of the monitor page by defaulting the date filter to 12 hours instead of 'all time', b/c all time doesn't actually represent all time and b/c no users actually look at all time anyway"
[master 23942d272] MCI-515: initial commit: speeding up load time of the monitor page by defaulting the date filter to 12 hours instead of 'all time', b/c all time doesn't actually represent all time and b/c no users actually look at all time anyway
 6 files changed, 349 insertions(+), 276 deletions(-)
 rewrite resources/vendor/quark-filters/dist/quark-filters.min.js.map (95%)
 nhunt@nicks-mbp  ~/Turner/newstron_client/newstron/videoingest   master ●  gst
On branch master
Your branch and 'origin/master' have diverged,
and have 1 and 50 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   ../cnn/services.js

no changes added to commit (use "git add" and/or "git commit -a")
 nhunt@nicks-mbp  ~/Turner/newstron_client/newstron/videoingest   master ●  git push
No user exists for uid 501
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
 ✘ nhunt@nicks-mbp  ~/Turner/newstron_client/newstron/videoingest   master ●  gco -b MCI-515
M	cnn/services.js
Switched to a new branch 'MCI-515'
 nhunt@nicks-mbp  ~/Turner/newstron_client/newstron/videoingest   MCI-515 ●  gst
On branch MCI-515
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   ../cnn/services.js

no changes added to commit (use "git add" and/or "git commit -a")
 nhunt@nicks-mbp  ~/Turner/newstron_client/newstron/videoingest   MCI-515 ●  gco master
M	cnn/services.js
Switched to branch 'master'
Your branch and 'origin/master' have diverged,
and have 1 and 50 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)
 nhunt@nicks-mbp  ~/Turner/newstron_client/newstron/videoingest   master ●  git reset --soft HEAD^
zsh: no matches found: HEAD^
 ✘ nhunt@nicks-mbp  ~/Turner/newstron_client/newstron/videoingest   master ●  git reset --soft HEAD^
zsh: no matches found: HEAD^
 ✘ nhunt@nicks-mbp  ~/Turner/newstron_client/newstron/videoingest   master ●  git reset --soft HEAD\^
 nhunt@nicks-mbp  ~/Turner/newstron_client/newstron/videoingest   master ●✚  gst
On branch master
Your branch is behind 'origin/master' by 50 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)

Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	modified:   ../resources/vendor/quark-filters/.bower.json
	modified:   ../resources/vendor/quark-filters/README.md
	modified:   ../resources/vendor/quark-filters/dist/quark-filters.min.js
	modified:   ../resources/vendor/quark-filters/dist/quark-filters.min.js.map
	modified:   ../resources/vendor/quark-filters/src/quark-filters.js
	modified:   js/videomonitor-page.js

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   ../cnn/services.js

 nhunt@nicks-mbp  ~/Turner/newstron_client/newstron/videoingest   master ●✚  gco MCI-515
M	cnn/services.js
Switched to branch 'MCI-515'
 nhunt@nicks-mbp  ~/Turner/newstron_client/newstron/videoingest   MCI-515 ●  gst
On branch MCI-515
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   ../cnn/services.js

no changes added to commit (use "git add" and/or "git commit -a")
 nhunt@nicks-mbp  ~/Turner/newstron_client/newstron/videoingest   MCI-515 ●  gst
On branch MCI-515
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   ../cnn/services.js

no changes added to commit (use "git add" and/or "git commit -a")
 nhunt@nicks-mbp  ~/Turner/newstron_client/newstron/videoingest   MCI-515 ●  gco master
M	cnn/services.js
Switched to branch 'master'
Your branch is behind 'origin/master' by 50 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)
 nhunt@nicks-mbp  ~/Turner/newstron_client/newstron/videoingest   master ●  gst
On branch master
Your branch is behind 'origin/master' by 50 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   ../cnn/services.js

no changes added to commit (use "git add" and/or "git commit -a")
 nhunt@nicks-mbp  ~/Turner/newstron_client/newstron/videoingest   master ●  gst
On branch master
Your branch is behind 'origin/master' by 50 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   ../cnn/services.js

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

## Nick Hunt, 2018-03-19 20:14

Subject: Re: Potential git bug
Message-ID: <CAJ-HmiZtHZ0qR9KdZ5mxzok18Ad6R8zLd3xwrvt+GQHu-qDrGQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAJ-HmiZtHZ0qR9KdZ5mxzok18Ad6R8zLd3xwrvt%2BGQHu-qDrGQ%40mail.gmail.com
In-Reply-To: <CAJ-HmiZFpGbe_kLUFoOibMgc2dtf=n5VXb=ReZjN2wNsja1Lrw@mail.gmail.com>

```
oh, wait, switching branches didn't vaporize my changes, it auto-committed them.
which is still weird and possibly a bug?
Nick Hunt
nhunt11@gmail.com
404-988-1845


On Mon, Mar 19, 2018 at 3:13 PM, Nick Hunt <nhunt11@gmail.com> wrote:
> i committed my changes, then ran
> git reset --soft HEAD^
> at this point everything is fine
> then i switched branches, and all of my changes vaporized into thin
> air. uhhh, is this supposed to happen?
>
> anyway, thank god intellij saves my work for me as i go, so i didn't
> have to re-write all my code.
>
> my bash/zsh commands are attached.
>
> thanks for the help! :)

```

## Jeff King, 2018-03-19 20:16

Subject: Re: Potential git bug
Message-ID: <20180319201644.GA25618@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20180319201644.GA25618%40sigill.intra.peff.net
In-Reply-To: <CAJ-HmiZtHZ0qR9KdZ5mxzok18Ad6R8zLd3xwrvt+GQHu-qDrGQ@mail.gmail.com>

```
On Mon, Mar 19, 2018 at 04:14:31PM -0400, Nick Hunt wrote:

> oh, wait, switching branches didn't vaporize my changes, it auto-committed them.
> which is still weird and possibly a bug?

Are you sure that the changes were not already present on the
switched-to branch?

-Peff

```
