-2
 npm ERR! code 1
   npm ERR! Command failed: /usr/bin/git checkout 95b2dd3fe63ec9b6c7cec4f63f8276f4d907f228
   npm ERR! error: Your local changes to the following files would be overwritten by checkout:
   npm ERR!     test/blobReach.png
   npm ERR! Please, commit your changes or stash them before you can switch branches.
   npm ERR! Aborting
   npm ERR! 

I dunno why this is happening, more details can be provided about the issue if and when asked

  • Have you tried googling that error message? https://stackoverflow.com/questions/15745045/how-do-i-resolve-git-saying-commit-your-changes-or-stash-them-before-you-can-me – Sush Oct 07 '18 at 03:18

1 Answers1

0

You've made uncommitted changes to the file test/blobReach.png. You need to either remove those changes or commit them before git will allow you to do any sort of checkout.

If you run git status it will show you all changed files, which right now should show test/blobReach.png. If you have important changes in that file then add and commit them before doing a checkout. Another option is to "stash" those changes, which hides them while allowing you to "unstash" them at a later time. Running git stash will take care of that for you. If you want to undo all of your changes to test/blobReach.png, there are a few ways to do that, all of which are described here.

Whichever option you choose, you have to do one of them before git will allow you to checkout any other branches. This is git's way of making sure you don't accidentally overwrite an important file.

guyot
  • 364
  • 1
  • 9
  • 1
    The thing is, heroku doesn't allow you to edit files like that. I've tried clearing the npm cache too but that doesn't seem to work either – user9114994 Oct 07 '18 at 07:41
  • To clarify, this issue is happening whilst heroku is building and occurs during my preinstall script which is "npm i -g pm2 && pm2 install pm2-logrotate" – user9114994 Oct 07 '18 at 14:08