리액트 에러 : This git repository has untracked files or...

리액트 에러 : This git repository has untracked files or...

리액트 에러 : This git repository has untracked files or uncommitted changes:

컴포넌트 스타일링을 하기위해서

$ yarn eject

를 입력 했더니 이런 에러가 발생하였습니다.

yarn run v1.12.3

$ react-scripts eject

? Are you sure you want to eject? This action is permanent. Yes

This git repository has untracked files or uncommitted changes:

src/App.css

D src/App.js

D src/App.test.js

D src/index.css

D src/logo.svg

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.

Remove untracked files, stash or commit any changes, and try again.

이 부분을 보고 구글링을 해서 아래 두 곳을 참고하여 찾은 해결 방법은 두가지입니다.

https://github.com/facebook/create-react-app/issues/4535

https://github.com/facebook/create-react-app/issues/2797

1. 커밋을 해준다.

$ git add .

$ git commit -am "Save before ejecting"

sitemap.xml

2. 깃 로컬저장소 연결을 해제한다.

$ rm -rf .git

이후 다시 실행해보시면 잘 됩니다.

$ yarn eject

from http://dublin-java.tistory.com/28 by ccl(S) rewrite - 2020-03-07 05:55:02

댓글

이 블로그의 인기 게시물

[React] - 18) 프로젝트 빌드하기(+코드 스플리팅)

단위 테스트 환경 구축

React에서 웹팩 설치하기