-1

I have this:

$ git checkout -- .
$ git pull
Updating 4411c31..db4498d
error: Your local changes to the following files would be overwritten by merge:
        index.js
        utils.js
Please commit your changes or stash them before you merge.
Aborting

I keep trying git checkout -- . and it keeps giving me the same message. How do I obliterate the local changes here? I don't wish to keep my changes to index.js and utils.js.

halfer
  • 19,824
  • 17
  • 99
  • 186
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
  • 2
    You may need to do a `git reset` first, if the changes have already been staged. – Jonathan Hall May 19 '18 at 19:08
  • If you wish to keep those changes, either `git stash` them or create a new branch `git checkout -b new-branch` and then commit changes. Change back to the original branch and then `git pull` – Todd May 22 '18 at 03:11

1 Answers1

1

My best guess would be that your files have been staged in git. That would mean that to get rid of the changes, you have to git reset HEAD . to unstage your changes, then git checkout -- . to actually get rid of them. If this is incorrect, could you please show the results of git status?

OrdoFlammae
  • 721
  • 4
  • 13