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

即可解决报错

相关文章
|
7月前
|
Shell 开发工具 git
【Git】解决Untracked Files Prevent Checkout的问题
【Git】解决Untracked Files Prevent Checkout的问题
459 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的解决办法
492 0
|
开发工具 git
【Git】报错解决cannot open .git/FETCH_HEAD: Permission denied
【Git】报错解决cannot open .git/FETCH_HEAD: Permission denied
1225 0
|
开发工具 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
243 0
|
开发工具 git
【已解决】git取消分支合并(fatal: There is no merge to abort (MERGE_HEAD missing).)
git取消分支合并(fatal: There is no merge to abort (MERGE_HEAD missing).)
979 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
101 0
Git冲突:# If this is not correct, please remove the file # .git/MERGE_HEAD
|
算法 安全 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:
639 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
698 0
|
开发工具 git
git提交出现running pre-commit hook: lint-staged
git提交出现running pre-commit hook: lint-staged
git提交出现running pre-commit hook: lint-staged
|
开发工具 git
git合并的时候,冲突问题Merging is not possible because you have unmerged files
git合并的时候,冲突问题Merging is not possible because you have unmerged files 简单的来说就是:
524 0
git合并的时候,冲突问题Merging is not possible because you have unmerged files