
git : 버전 관리 프로그램 / github : 원격 저장소, 클라우드
github 에서 레포 생성 후 프로젝트 시작git clone repository 주소git add . 이 바로 적용이 안됨 ! 아래 순서로 진행 필요.git init : .git 폴더 생성됨. 기본 branch는 master.git remote add origin [repository 주소]origin이란, 깃허브 저장소 주소를 의미. (즉, 원격저장소를 의미)git remote set-url origingit config --global user.name "tteia"
git config --global user.email "tteia.dl@gmail.com"
git config --local user.name "tteia"
git config --local user.email "tteia.dl@gmail.com"
💡 둘 다 설정되어있다면? 지역적 우선 !
origin의 데이터를 local 로 가져오되, 병합은 하지 않는 것 !
✋🏻 잠깐 !
mac os 소스트리에서 자동으로 fetch 될 때 !
소스트리 설정 > 고급에서 해제 가능 !
local repository 까지 커밋 이력을 가져오지만, staging과 working directory에는 반영되지 않는다.
git fetch origin main > git merge origin/main
fetch 로 가져온 뒤 merge 로 합친다 !
❗️❗️ 주의사항 ❗️❗️
git push origin main, git fetch origin main 등
로컬에서 원격을 대상으로 작업시에는 origin main 을 사용하지만,
로컬에서 git diff (두 커밋 간 차이점 비교) 또는 git merge 등을 사용하여
로컬내의 origin 을 참조할때에는 origin/main 사용 !