티스토리 뷰

 

 

* 배경설명
- 맥 터미널 관련해서 각종 프로그램 다운 후 개인 프로젝트 git push가 안됨
- 주로 Intellij에서 commit하고나서 push 창에 아무것도 안뜸
- HEAD가 분리되었다는 에러 발생

 

해결방법 : 임시 branch 생성 후 branch 강제 통합하여 해결

 

 

// 임시 branch 생성
git branch temp

// 임시 branch로 전환
git checkout temp

// master branch로 temp branch를 강제 변경
git branch -f master temp

// 임시 branch 삭제
git branch -d temp

// 최초 push
git push --set-upstream origin master 

// master branch로 전환
git checkout master

// main branch로 master branch를 강제 변경
git branch main master -f

// main branch로 전환
git checkout main

// push
git push origin main -f

 

* 맥에서 저장 시 .DS_store 생성되는 경우 삭제 명령어

 find . -name .DS_Store -print0 | xargs -0 git rm --ignore-unmatch -f

 

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/07   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
글 보관함