react eject提示This git repository has untracked files or uncommitted changes:
在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:的更多相关文章
- npm run eject 命令后出现This git repository has untracked files or uncommitted changes错误
npm run eject 暴露隐藏的文件,不可逆 结果出现下面的问题 This git repository has untracked files or uncommitted changes: ...
- Git操作----删除untracked files
# 删除 untracked files git clean -f # 连 untracked 的目录也一起删掉 git clean -fd # 连 gitignore 的untrack 文件/目录也 ...
- 删除git库中untracked files(未监控)的文件
https://blog.csdn.net/ronnyjiang/article/details/53507306 在编译git库拉下来的代码时,往往会产生一些中间文件,这些文件我们根本不需要,尤其是 ...
- Git操作删除 untracked files
最近使用git 管理项目的时候,编译过程中出现了很多中间文件,今天发现使用 git clean 命令可以很方便进行清除: # 删除 untracked files git clean -f # 连 u ...
- 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 ...
- git 上传文件到仓库上提示:origin does not to be a git repository
最近上传代码到GitHub的时候,当我输入 git push -u origin master的时候,它提示: origin does not to be a git repository 在网上找到 ...
- git: fatal: Not a git repository (or any of the parent directories): .git
在看书 FlaskWeb开发:基于Python的Web应用开发实战 时,下载完源码后 git clone https://github.com/miguelgrinberg/flasky.git 试着 ...
- git 解决fatal: Not a git repository
我用git add file添加文件时出现这样错误: fatal: Not a git repository (or any of the parent directories): .git 提示说没 ...
- 把Git Repository建到U盘上去(转)
把Git Repository建到U盘上去 转 把Git Repository建到U盘上去 Git很火.原因有三: 它是大神Linus Torvalds的作品,天然地具备神二代的气质和品质: 促进了生 ...
- 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添加文件时出现这样错误 ...
随机推荐
- C语言 ini 文件读写【Iniparser库】
一.概述 iniparser是针对INI文件的解析器.ini文件则是一些系统或者软件的配置文件.iniparser库的API可以对ini文件(配置文件)进行解析.设置.删除等操作. 常见的 ini 读 ...
- Java 泛型与通配符 定义与使用
一.泛型 定义: 把类型明确的工作推迟到创建对象或调用方法时才明确的类型,简而言之,未明确的数据类型. 类型: 泛型类,泛型方法,方形接口. 格式 泛型类格式:class 类名<E变量>{ ...
- 在进行程序国际化时(Locale)遇到的问题
Java程序国际化-Question 为了使程序能够个根据不同的国家/语言环境来输出不同的内容,通常需要把将需要输出的内容定义在资源文件中. 而在创建资源文件的过程中难免会出现问题,我遇到了在创建资源 ...
- 怎么在php7项目中安装event扩展
今天就跟大家聊聊有关怎么在php7项目中安装event扩展,可能很多人都不太了解,为了让大家更加了解,小编给大家总结了以下内容,希望大家根据这篇文章可以有所收获. 安装支持库libevent wget ...
- noopener, noreferrer 及 nofollow 的用法
<a> 标签通常会配合着使用 noopener, noreferrer 及 nofollow 这些属性, 它们的作用及用法如下. noopener 当给链接加上 target=" ...
- 别逛了,送你一份2023年Java核心篇JVM(虚拟机)面试题整理
Java内存区域 说一下 JVM 的主要组成部分及其作用? JVM包含两个子系统和两个组件,两个子系统为Class loader(类装载).Execution engine(执行引擎):两个组件为Ru ...
- 使用 diffusers 训练你自己的 ControlNet 🧨
简介 ControlNet 这个神经网络模型使得用户可以通过施加额外条件,细粒度地控制扩散模型的生成过程.这一技术最初由 Adding Conditional Control to Text-to-I ...
- Java面向对象--接口和多态
final 关键字 最终修饰符 可以修饰 类 方法 变量 被final修饰后不能被继承 重写 二次赋值 修饰类时 该类不可以被继承 修饰方法时 该方法不能被重写 修饰变量时, 该变量只能赋值一次, 不 ...
- win32print常用函数
这里整理下win32print的API介绍,官网地址http://timgolden.me.uk/pywin32-docs/win32print.html OpenPrinter 打开指定的打印机,并 ...
- window远程桌面
此文档概述如何开启win8.win8.1系统的远程桌面连接服务,可以让我们从一台电脑远程连接的其他电脑! 同时按"win键+R键",再打开的运行对话框中输入"contro ...