본문 바로가기

리액트 에러 : 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