IT/Git
[Git]자주 쓰는 명령어 정리
유달잇
2021. 1. 13. 00:59
728x90
1. git branch
: 깃 브랜치 확인
2. git branch branchname
: branchname 이라는 깃 브랜치 생성
3. git branch -D branchname
: branchname 브랜치 삭제
4. git checkout branchname
: branchname으로 브랜치 이동
5. git status
: 깃 상태 확인
6. git add
: 깃 파일 추가
ex)git add test.txt / git add .
7. git commit -m "커밋 메세지"
: 깃 파일 커밋
8. git commit -a
: 자동으로 add 후 커밋
9. git commit --amend
: 최신 커밋 메세지 수정, 편집 후 esc -> :wq
10. git push origin branchname
: 깃허브에 branchname의 브랜치를 올리는 것
11. git pull origin main
: 깃허브의 파일을 로컬 저장소로 가져오기
12. git log
: 저장소의 내역 확인
13. git push --force branchname
: branchname의 브랜치를 강제로 깃허브에 올리는 것
728x90