1.
브랜치 생성
a.
로컬 브랜치 생성
git checkout -b {브랜치 이름}
Plain Text
복사
b.
리모트 브랜치 생성
git push origin {브랜치 이름}
Plain Text
복사
2.
브랜치 삭제
a.
로컬 브랜치 삭제
git branch -D {브랜치 이름}
Plain Text
복사
b.
리모트 브랜치 삭제
git push origin —delete feature/TEST-860
Plain Text
복사
3.
리모트 브랜치 가져오기
git remote update (브랜치 갱신)
git checkout -t origin/{브랜치이름}
PowerShell
복사
4.
특정 브랜치만 clone
git clone -b {브랜치 이름} —single-branch {저장소 URL}
PowerShell
복사
5.
여러 commit 합치기
git rebase -i HEAD~{원하는 커밋 수}
PowerShell
복사
6.
stash 기능
rebase를 해야하는데 작업하는게 남아있는 경우 등에 사용
a.
stash로 현재 상태 따로 저장해두기
git stash
Plain Text
복사
b.
stash 불러와 적용시키기
git stash apply
PowerShell
복사
7.
되돌리기
a.
add 되돌리기
git reset HEAD {파일 이름}
PowerShell
복사
b.
commit 되돌리기
하나만 취소
git reset HEAD^
여러개 취소
git reset HEAD~{취소할 커밋 수}
PowerShell
복사
8.
up-stream-to 설정
git branch —set-upstream-to origin/{branch 이름}
PowerShell
복사
9.
commit 메세지 변경
git commit —amend -m "{message}"
PowerShell
복사
성균관대학교 소프트웨어/컴퓨터공학과 단톡방의 '영원히 안고통받는..' 님의 정리본입니다.