解决报错:Remove untracked files, stash or commit any changes, and try again

简介: 解决报错:Remove untracked files, stash or commit any changes, and try again

在执行npm run eject的时候,有这样的报错

This git repository has untracked files or uncommitted changes:
package-lock.json
M package.json
M src/index.js
src/pages/
Remove untracked files, stash or commit any changes, and try again.

因为工程默认的git 导致的(git配置文件)

因为我们使用脚手架创建一个项目的时候,自动给我们增加了一个.gitignore文件

解决办法

我们本地却没有文件仓库

这就需要在终端输入如下命令

用git将项目添加到我们的本地仓库

gitadd .
git commit -m 'up'

再次执行

npm run eject

即可解决报错

相关文章
|
9月前
|
Shell 开发工具 git
【Git】解决Untracked Files Prevent Checkout的问题
【Git】解决Untracked Files Prevent Checkout的问题
881 0
【异常】svn: E200009: Commit failed (details follow)/both sides of the move must be committed together的解决办法
svn: E200009: Commit failed (details follow)/both sides of the move must be committed together的解决办法
535 0
|
开发工具 git
Git冲突:# If this is not correct, please remove the file # .git/MERGE_HEAD
Git冲突:# If this is not correct, please remove the file # .git/MERGE_HEAD
106 0
Git冲突:# If this is not correct, please remove the file # .git/MERGE_HEAD
SVN更新有问题 svn The working copy at‘ ‘ is too old
SVN更新有问题 svn The working copy at‘ ‘ is too old
SVN更新有问题 svn The working copy at‘ ‘ is too old
|
开发工具 git
git更新:Your local changes to the following files would be overwritten by merge
git更新:Your local changes to the following files would be overwritten by merge
249 0
|
开发工具 git
【已解决】git取消分支合并(fatal: There is no merge to abort (MERGE_HEAD missing).)
git取消分支合并(fatal: There is no merge to abort (MERGE_HEAD missing).)
1024 0
|
Linux 开发工具 git
【Git】解决:E:/**/.git/index.lock': File exists
【Git】解决:E:/**/.git/index.lock': File exists
254 0
|
算法 安全 Linux
Git 拉取项目小技巧之切换分支error: The following untracked working tree files would be overwritten by checkout:
Git 拉取项目小技巧之切换分支error: The following untracked working tree files would be overwritten by checkout:
673 0
Git 拉取项目小技巧之切换分支error: The following untracked working tree files would be overwritten by checkout:
|
开发工具 git
Git - Error:The following untracked working tree files would be overwritten by checkout
Git - Error:The following untracked working tree files would be overwritten by checkout
725 0

热门文章

最新文章