혼자서
fork한 repository 가져오기
git clone repository명
repository 상태 확인
git status
로컬 파일을 staging area로 이동
git add 로컬파일명
staging area의 내용을 commit
git commit -m "커밋 명"
커밋 취소
git reset HEAD-1 또는 git reset HEAD^
commit한 내용을 github repository에 등록
git push repository명 branch명
커밋 로그 확인
git log
여럿이
git 초기화
git init
리모트 연결
git remote add 내repository명 링크
페어의 리모트 연결
git remote add 페어repository명 링크
리모트 확인
git remote -v
페어의 작업물 가져오기
git pull 페어repository명 branch명
페어와 merge된 작업물 등록
git push 내repository명 branch명
충돌 발생 시(같은 원격 repository에 같은 파일이 수정하여 pull할 경우, 충돌 발생)
충돌 부분 수정 후 staging area에 추가
git add 로컬파일명
commit(충돌 수정 후 staging area에 추가하면 자동으로 commit 메시지 생성됨)
git commit
push
git push repository명 branch명
브랜치 관련 명령
브랜치 목록 확인
git branch
브랜치 생성
git branch 브랜치명
브랜치 이동
git checkout 브랜치명
브랜치 생성 후 해당 브랜치로 이동
git checkout -b 브랜치명
브랜치 병합
git merge 병합될브랜치명
'github' 카테고리의 다른 글
[Github Actions] 빌드 디렉토리(working directory) 변경 (0) | 2022.11.14 |
---|---|
git 사용법 익히기(learngitbranching) (0) | 2022.07.01 |
github ssh 키 생성 및 등록 (0) | 2022.07.01 |