在yarn eject 但时 老是提示This git repository has untracked files or uncommitted changes:
Remove untracked files, stash or commit any changes, and try again.

D:\react>yarn eject
yarn run v1.22.10
$ react-scripts eject
NOTE: Create React App 2+ supports TypeScript, Sass, CSS Modules and more without ejecting: https://reactjs.org/blog/2018/10/01/create-react-app-v2.html √ Are you sure you want to eject? This action is permanent. ... yes
This git repository has untracked files or uncommitted changes: package.json
M src/index.js
M yarn.lock
.eslintcache
src/pages/ Remove untracked files, stash or commit any changes, and try again.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

这时为什么呢,原因是在创建脚手架时添加了.gitgnore文件,但是却没有本地仓库,所以要初始化一个本地库。这样操作后,我们就可以看到如下运行成功的结果了:

git init
git add .
git commit -m 'init'
npm run eject 或者 yarn eject

这样就会看见执行成功了

好执行成功再看看

项目目录中已经多出来一个config 文件了这个就可以开始进行webpack配置了

react eject提示This git repository has untracked files or uncommitted changes:的更多相关文章

  1. npm run eject 命令后出现This git repository has untracked files or uncommitted changes错误

    npm run eject 暴露隐藏的文件,不可逆 结果出现下面的问题 This git repository has untracked files or uncommitted changes: ...

  2. Git操作----删除untracked files

    # 删除 untracked files git clean -f # 连 untracked 的目录也一起删掉 git clean -fd # 连 gitignore 的untrack 文件/目录也 ...

  3. 删除git库中untracked files(未监控)的文件

    https://blog.csdn.net/ronnyjiang/article/details/53507306 在编译git库拉下来的代码时,往往会产生一些中间文件,这些文件我们根本不需要,尤其是 ...

  4. Git操作删除 untracked files

    最近使用git 管理项目的时候,编译过程中出现了很多中间文件,今天发现使用 git clean 命令可以很方便进行清除: # 删除 untracked files git clean -f # 连 u ...

  5. linux git 报错提示 fatal: 'origin' does not appear to be a git repository 解决办法

    输入: git pull origin master git报错提示 fatal: 'origin' does not appear to be a git repository fatal: Cou ...

  6. git 上传文件到仓库上提示:origin does not to be a git repository

    最近上传代码到GitHub的时候,当我输入 git push -u origin master的时候,它提示: origin does not to be a git repository 在网上找到 ...

  7. git: fatal: Not a git repository (or any of the parent directories): .git

    在看书 FlaskWeb开发:基于Python的Web应用开发实战 时,下载完源码后 git clone https://github.com/miguelgrinberg/flasky.git 试着 ...

  8. git 解决fatal: Not a git repository

    我用git add file添加文件时出现这样错误: fatal: Not a git repository (or any of the parent directories): .git 提示说没 ...

  9. 把Git Repository建到U盘上去(转)

    把Git Repository建到U盘上去 转 把Git Repository建到U盘上去 Git很火.原因有三: 它是大神Linus Torvalds的作品,天然地具备神二代的气质和品质: 促进了生 ...

  10. git错误:fatal: Not a git repository (or any of the parent directories): .git

    git错误:fatal: Not a git repository (or any of the parent directories): .git 我用git add file添加文件时出现这样错误 ...

随机推荐

  1. Windows 11 正式版(2021/10/19更新)

    Windows 11 (business editions), version 21H2 (updated October 2021) (x64) - DVD (Chinese-Simplified) ...

  2. mybatis-spring注解MapperScan的原理

    很多开发者应该都知道,我们只使用@MapperScan这个注解就可以把我们写的Mybatis的Mapper接口加载到Spring的容器中,不需要对每个Mapper接口加@Mapper这个注解了,加快了 ...

  3. 《C++ STL编程轻松入门基础》溯源

    由一PDF文档(<认识 C++STL>--Vtech Electronic Ltd (SZ) VTE/TV2 terrcy tang)而来,以为不完整,寻求更完全版. 后搜索"第 ...

  4. 二进制安装Kubernetes(k8s) v1.23.4

    1.环境 网段 物理主机:192.168.1.0/24 service:10.96.0.0/12 pod:172.16.0.0/12 如果有条件建议k8s集群与etcd集群分开安装 1.1.k8s基础 ...

  5. w10共享打印机出现011b错误

    错误描述:在更新里面没有发现所说的500补丁,可就是报上面的错误,然后百度找答案 解决方案1 WIN10无法连接共享打印机0x0000011b的解决方法,不用卸载更新,在共享打印机的电脑上,打开注册表 ...

  6. [网络]内网IP的判别与分类

    1 内网IP划分 内网IP地址分为A类.B类和C类,其地址范围如下: A类地址: 10.0.0.0 - 10.255.255.255 B类地址: 172.16.0.0 - 172.31.255.255 ...

  7. [Linux]常用命令之【top/uptime/w/vmstat/free】

    1 top 语法:top [-s time] [-d count] [-q] [-u] [-h] [-n number] [-f filename] -s time 设置屏幕刷新的延时,单位为秒,默认 ...

  8. must be reducible node 错误

    "must be reducible node"错误通常是由于使用了无法转换为表达式树的代码或表达式. 场景再现:在项目中使用GroupBy的时候,对字段进行了类型转换,接下来正常 ...

  9. mybatis:Could not set parameters for mapping: ParameterMapping

    报错: 展开查看 org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org. ...

  10. 做个清醒的程序员之拥抱AI

    阅读时长约 13 分钟,共计约 3100个字. 昨天我体验了AI自动生成短视频,具体说来,首先我在域名为FreeGPT的免费网站,向它提问,然后生成一段文字.之后呢,再用剪映里面的"图文成片 ...