nyximos.log

[에러] warning: LF will be replaced by CRLF in .gitattributes.The file will have its original line endings in your working directory 본문

Programming/Git&GitHub

[에러] warning: LF will be replaced by CRLF in .gitattributes.The file will have its original line endings in your working directory

nyximos 2022. 2. 7. 17:00

 

Spring Boot와 Vue.js를 설치, 연동후 커밋하려니까 이런 에러가 떴다.

 

warning: LF will be replaced by CRLF in .gitattributes.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in .gitignore.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in build.gradle.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in gradle/wrapper/gradle-wrapper.properties.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in gradlew.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in README.md.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in settings.gradle.
The file will have its original line endings in your working directory
error: invalid path 'src/frontend/'
error: src/frontend/: cannot add to the index - missing --add option?
fatal: Unable to process path src/frontend/

 

 

git config --global core.autocrlf true

구글에서 이렇게 하면 된다해서 해봤는데 나는 안된다.

 

stackoverflow에서 해결방법을 찾았다.

 

.gitattributes 파일을

# Auto detect text files and perform LF normalization
* text=auto

 

이렇게 수정해준다.

*.txt text
*.html text
*.css text
*.js text

 

에러가 좀 사라졌지만 여전히 있다.

 

 

 

 

 

git add --all

 

안됨

hint: You've added another git repository inside your current repository.
hint: Clones of the outer repository will not contain the contents of
hint: the embedded repository and will not know how to obtain it.
hint: If you meant to add a submodule, use:
hint: 
hint:   git submodule add <url> src/frontend
hint: 
hint: If you added this path by mistake, you can remove it from the
hint: index with:

 

시키는대로 해보자.

git submodule add

 

겨우 커밋했다.

 

커밋을 하고 push를 하려니 또 실패했다.

에러 넘어 에러..

Authentication failed. Some common reasons include:

- You are not logged in to your account: see File > Options.
- You may need to log out and log back in to refresh your token.
- You do not have permission to access this repository.
- The repository is archived on GitHub. Check the repository settings to confirm you are still permitted to push commits.
- If you use SSH authentication, check that your key is added to the ssh-agent and associated with your account.
- If you use SSH authentication, ensure the host key verification passes for your repository hosting service.
- If you used username / password authentication, you might need to use a Personal Access Token instead of your account password. Check the documentation of your repository hosting service.

 

git config --system --unset credential.hellper

안돼서 global로 해봤는데 여전히 똑같은 에러가 떴다.

git config --global --unset credential.hellper

 

안된다..

 

 

결국 해결하지 못했다.

밥먹고 돌아와서 깃허브를 삭제,재설치하고 스프링부트 프로젝트 커밋 후, Vue.js 설치하고 연동 하니까 아무런 에러가 안떴다.

뭐가 문제였던 걸까..

 

다른 해결 방법을 더 찾아볼걸 싶기도 하다.

git push access error 해결 방법1

git push access error 해결 방법2

git push access error 해결 방법3

 

 

 

 

git 공부의 필요성을 느낀 하루다.

 

 

 

참조

https://stackoverflow.com/questions/21472971/what-is-the-purpose-of-text-auto-in-gitattributes-file

 

What is the purpose of `text=auto` in `.gitattributes` file?

Mostly .gitattributes file has * text=auto. What is the purpose of text=auto in that file?

stackoverflow.com