Git 명령어 모음

Git 2019. 11. 26. 10:02 Posted by Vispera

git config --global user.name "홍길동"
git config --global user.email ehddnr177@naver.com
git config --list

git clone [url] // 저장소 복제
git add [filename] // 작업 영역에서 준비 영역으로 저장 및 파일 생성
git reset [filename] // 취소 및 재편집
git commit -m [filename] // 준비 영역에서 .git에 저장
git push // gitlab에 최종 반영
git push -u origin master
-u 옵션: 새로운 기능 브랜치와 똑같은 이름으로 중앙 원격 저장소의 브랜치로 추가한다.
git log // 파일 저장 순서 확인
git log --graph --all
git status // git 상태


git branch // branch 목록
git branch [name] //  branch 생성
git checkout [name] // branch 바꾸기
git checkout -b [name] // branch name을 생성하고 스위칭함
git diff // 파일 내용 바뀐거 체크

git merge master -> :q
git branch -d [삭제할 브랜치 이름] // branch 삭제
-> 강제 삭제 : -D