본문 바로가기
Git

[Git] 문제 해결

by 카피마스터 2023. 6. 4.

원격 저장소를 Clone 했는데 파일들이 보이지 않는경우

Branch가 동일한지 확인

서버의 기본 Branch가 main이고 클라이언트이 기본 Branch가 master일때 Clone하는경우 클라이언트는 master branch를 checkout하고있기 때문에 main branch의 파일이 보이지 않는다.

git checkout main으로 이동하던지

git config --global init.defaultBranch "이름" 로 디폴트 브랜치를 변경해준다

 

 

error: failed to push some refs to '저장소'

git 저장소에 내 로컬에는 없는 파일이 있을때 발생

pull 후 push 해주면 해결. pull이 동작하지 않는다면 옵션 추가 git pull origin main.

 

 

fatal : You are not currently on abranch.

To push the history leading to the current (detached HEAD)

...