
깃을 설치하고 사용하기 위한 최초 설정이 필요
터미널(Mac) or 프롬프트(윈도우) 창을 열고 다음과 같은 명령어를 입력
git config --global user.name "본인 이름"
git config --global user.email "본인 이메일 주소"
제대로 입력되었는지 확인을 위해 아래 명령어 입력
git config --list
git init // git폴더 생성 + 기본 branch가 main으로 설정
git add . // 파일을 저장하기 전 상태(commit)으로 변경
git commit -m "저장 메시지" // 로컬환경에 파일 저장
git status // 상태 확인
git remote add origin <github repositiry 주소>
// 해당 URL을 origin이라는 이름으로 원격저장소로 정함
git branch -M main
// 현재 branch를 Main이라는 branch로 설정
// 일반적으로 초기 세팅할 때 사용
git push -u origin main
// main 브랜치의 변경사항을 origin이라는 원격 저장소의 main 브랜치로 업로드
// -u 옵션을 통해 로컬 브랜치와 원격 브랜치를 연결
// 이후에는 git push만 입력하면 자동으로 origin main으로 업로드
git switch - c develop // develop이라는 테스트용 branch생성
git push origin develop // develop이라는 branch를 서버에 업로드
방법 : settings - Default branch - ⇆ 버튼 - 브랜치 선택 - Update 버튼
방법 : settings - collaborators - Add people - 이름 선택 후 추가 - 초대 받은 사람은 수락
cd ..를 통해 바탕화면으로 이동하기git clone gitRepository주소 . 입력git clone을 입력하면 git init이 같이 실행돼서 git init을 입력할 필요가 없음git switch - c 기능브랜치이름
git pull origin develop
// origin : repository 주소
// develop : 가져올 branch명
git add .
git commit -m "저장 메시지"
// git status
git push
git push --set-upstream origin feature/branch명 등으로 오류가 나온다면 그대로 Terminal에 작성해주면 됨Compare & pull request 버튼 base 브랜치 ← 기능 브랜치 확인혹은 Terminal에서..
git switch 최종브랜치이름
git merge 합칠브랜치이름
git pull origin 브랜치명

