[Git] 명령어 정리
미음제
·2021. 4. 24. 23:54
Git hub 생성 후
# git init
# git add .
# git commit -m "커밋 내용"
# git remote add origin (git hub url)
# git push origin master
git에 올라온 code 내려받기
# git clone git hub url[파란 부분]
브랜치 생성하기
# git branch (branch 명)
브랜치 이동하기
# git checkout (branch 명)
브랜치 목록 탐색
# git branch -r
# git branch -a
-r : 원격 브랜치 목록
-a : 로컬/원격 모든 브랜치 목록
branch 변경사항 적용하기
# git checkout master
# git pull origin (branch 명)
-master에서 branch의 내용을 pull
# git push origin master
merge된 내용을 master로 push
브랜치 삭제
git branch -D (branch 명)
코드 stash
# git stash
stash 영역에 코드를 잠시 저장하는 것
stash는 LIFO구조로 이루어져 있다.
#git stash pop
마지막에 저장한 코드 불러오기
git reset, revert
victorydntmd.tistory.com/79#diff
git commit 히스토리 조회
# git log
파일들의 상태 확인하기
git status
'Developer > Git' 카테고리의 다른 글
[Git Hub] Commit Message Conventions / Commit Message Convention 준수하기 (0) | 2021.11.26 |
---|