일본IT외노자생활

git 오류 모음 본문

IT/git

git 오류 모음

VEGAS 2022. 6. 29. 17:00

git master로 push 했을때 main에 push 반영 안될 때

"main and master are entirely different commit histories."

"There isn't anything to compare. Nothing to compare, branches are entirely different commit histories"

git checkout master

git branch main master -f

git checkout main

git push origin main -f


git add 하려 했을때 오류

warning: LF will be replaced by CRLF in portfolio/static/css/styles.css.
The file will have its original line endings in your working directory

git config --global core.autocrlf true

 

참고 : https://blog.jaeyoon.io/2018/01/git-crlf.htmlg

 

Git 에러 CRLF will be replaced by LF (혹은 반대) 핸들링하는 방법

맥/리눅스 이용 개발자와 윈도우 개발자가 협업할 때 왜 발생할까? 터미널에 git 명령어를 입력했는데 다음과 같은 에러가 뜨는 경우가 있다: ```bash warning: CRLF will be replaced by LF in some/file

blog.jaeyoon.io


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

=> git init 으로 해결


git log --decorate --all --oneline

=> git fetch origin 했을때 제대로 가져와 졌는지 확인할 때 사용


git pull이 안먹힐 때 / git pull Already up to date.

git fetch --all 
git reset --hard origin/master

=> master 를 -> origin/master 로 강제 리셋 시키는 방법

원격저장소를 전부 fetch 한 후,

해당 브랜치로 --hard 옵션을 주어 reset

 

현재 로컬에만 있는 코드들은 날아갈 수 있으니 주의!


github 토큰 인증

https://hyeo-noo.tistory.com/184

 

[Mac] GitHub push token 오류 해결

Github 오류 7.29일 새벽 갑자기 git push가 안 되는 현상을 겪었다. 오류의 첫 줄이 무슨 말이냐면 Password 인증방식이 일시적으로 brownout(shutdown?)되었다. Password 대신에 personal access token을 사용..

hyeo-noo.tistory.com


git  push origin master 안먹을때

git push -f --set-upstream origin main

=> 강제 push


파일 추가시 git add, git commit 안될 때

추가한 폴더 안에 들어가서 숨김파일표시 -> .git 파일 삭제다시 원래 위치로 돌아와서 다시 git add, git commit, git push 진행

추가한 폴더 이름을 바꾸고 다시 git add, git commit, git push 진행

'IT > git' 카테고리의 다른 글

git 명령어 모음  (0) 2022.06.22
Comments