Error trying to checkout 1.5.x branch
-
So I updating everything to current on the 1.x.x branch and noticed it was still 1.4.6.
I found this thread stating why it changed, so I wanted to switch to the 1.5.x branch but received this error.
[root@daermabb nodebb]# git branch master v0.9.x * v1.x.x [root@daermabb nodebb]# git checkout v1.5.x error: Your local changes to the following files would be overwritten by checkout: package.json Please, commit your changes or stash them before you can switch branches. Aborting
-
What would have done this?
I just did
git reset --hard
and moved on, but I did not change any files myself either that should have caused this. -
@JaredBusch you said you were using npm@5 earlier, right? well npm@5 defaults to the
--save
behavior, which will modify the package.json. -
@JaredBusch said in Error trying to checkout 1.5.x branch:
error: Your local changes to the following files would be overwritten by checkout:
package.jsonSo I think they covered how it happened up top, but I thought I'd make sure you knew the fix in case it isn't something you've done before.
git stash
This will push the changes "aside" and let you check out/pull/etc.
-
@PitaJ said in Error trying to checkout 1.5.x branch:
@JaredBusch you said you were using npm@5 earlier, right? well npm@5 defaults to the
--save
behavior, which will modify the package.json.Awesome. Thanks for the answer.
-
@Shard said in Error trying to checkout 1.5.x branch:
@JaredBusch said in Error trying to checkout 1.5.x branch:
error: Your local changes to the following files would be overwritten by checkout:
package.jsonSo I think they covered how it happened up top, but I thought I'd make sure you knew the fix in case it isn't something you've done before.
git stash
This will push the changes "aside" and let you check out/pull/etc.
Yeah, sorry I was not clear on that. I know how to use git. The post was mostly to have the behavior documented.
-
No worries. Better safe than sorry. L:)
-
@Shard said in Error trying to checkout 1.5.x branch:
No worries. Better safe than sorry. L:)
So true