[英]Everytime I try to deploy stable branch I get this error
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我不知道为什么会发生这种情况,如果询问,可以提供有关该问题的更多详细信息
You've made uncommitted changes to the file test/blobReach.png
.您对文件
test/blobReach.png
进行了未提交的更改。 You need to either remove those changes or commit them before git will allow you to do any sort of checkout.您需要在 git 允许您进行任何类型的结帐之前删除这些更改或提交它们。
If you run git status
it will show you all changed files, which right now should show test/blobReach.png
.如果您运行
git status
它将显示所有更改的文件,现在应该显示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.运行
git stash
会为你解决这个问题。 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 .如果您想撤消对
test/blobReach.png
所有更改,有几种方法可以做到,所有这些都在此处进行了描述。
Whichever option you choose, you have to do one of them before git will allow you to checkout any other branches.无论您选择哪个选项,您都必须在 git 允许您签出任何其他分支之前执行其中一个选项。 This is git's way of making sure you don't accidentally overwrite an important file.
这是 git 确保您不会意外覆盖重要文件的方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.