解决报错: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

即可解决报错

相关文章
|
Shell 开发工具 git
【Git】解决Untracked Files Prevent Checkout的问题
【Git】解决Untracked Files Prevent Checkout的问题
2139 0
|
7月前
|
存储 开发工具 git
【SourceTree】Your local changes to the following files would be overwritten by merge【解决办法】
【SourceTree】Your local changes to the following files would be overwritten by merge【解决办法】
【异常】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的解决办法
702 0
|
开发工具 git
git 报错:fatal: refusing to merge unrelated histories?
git 报错:fatal: refusing to merge unrelated histories?
133 0
git 报错:fatal: refusing to merge unrelated histories?
SVN更新有问题 svn The working copy at‘ ‘ is too old
SVN更新有问题 svn The working copy at‘ ‘ is too old
165 0
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
270 0
|
开发工具 git
【已解决】git取消分支合并(fatal: There is no merge to abort (MERGE_HEAD missing).)
git取消分支合并(fatal: There is no merge to abort (MERGE_HEAD missing).)
1170 0
|
Java 开发工具 Maven
git解决error: The following untracked working tree files would be overwritten by c
git解决error: The following untracked working tree files would be overwritten by c
1697 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:
748 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
805 0