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

即可解决报错

相关文章
|
开发工具 git druid
解决Git中fatal: refusing to merge unrelated histories
Git的报错 在使用Git的过程中有时会出现一些问题,那么在解决了每个问题的时候,都需要去总结记录下来,下次不再犯。 一、fatal: refusing to merge unrelated histories 今天在使用Git创建项目的时候,在两个分支合并的时候,出现了下面的这个错误。
109160 6
|
Shell 开发工具 git
【Git】解决Untracked Files Prevent Checkout的问题
【Git】解决Untracked Files Prevent Checkout的问题
2804 0
|
存储 开发工具 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的解决办法
826 0
|
开发工具 git
git 报错:fatal: refusing to merge unrelated histories?
git 报错:fatal: refusing to merge unrelated histories?
184 0
git 报错:fatal: refusing to merge unrelated histories?
|
开发工具 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
314 0
|
开发工具 git
【已解决】git取消分支合并(fatal: There is no merge to abort (MERGE_HEAD missing).)
git取消分支合并(fatal: There is no merge to abort (MERGE_HEAD missing).)
1316 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
1894 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:
804 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
870 0
OSZAR »