git status -s: 상태 간단하게 확인
git diff: 변경/추가 된 내용 확인
cat: 문서의 내용 확인 ex) cat c.txt
git config —global alias.st status: git status를 git st로 줄여서 사
git commit -a: git add와 동시에 commit
git commit -am {MSG}: git add와 동시에 commit하며 메세지 입력
git branch: 현재 branch 보기
git branch {name}: branch 생성
git checkout {name}: {name}의 브랜치로 들어간다.
git log —branches: branch의 commit상태를 보여준다.
git log —branches —graph: branch의 흐름을 보여줌
git log —branches —graph —online: 위를 한줄로 보여준다.
git merge exp: exp의 commit 내용을 master에 포함시킨다. (단, checkout이 master 상태일 때)
git branch -d {name}: {name} branch가 삭제 됨.
git checkout -b exp: exp라는 branch를 생성하고 바로 checkout 한다.
git stash: 작업중인 내용을 숨긴다.
(단, 버전관리 중인 파일만 = working directory에 있는 내용만 가능, git add된 파일)
ex) branch exp로 작업중이다가 master로 작업해야 할 때 사용→ stash를 하지 않으면 exp에서 작업중이던 내용이 master에도 영향이 간다.
git stash apply: 작업중인 내용을 불러온다.
git stash list: stash한 항목을 보여준다.
git reset —hard: 가장 최근의 커밋상태로 되돌려준다.
git stash 후 git reset —hard를 해도 git stash apply로 숨긴 작업물을 가져올 수 있다.
git stash drop: 최근 stash를 삭제한다.
git stash pop: stash가 apply 된 후 drop 된다.
git reset —hard commitVersion: 해당 커밋 버전으로 되돌려준다.
git reflog: 커밋의 기록을 보여준다.
git commit —ament: 커밋 내용을 바꾼다.
git push
git pull
git clone {URL} {FOLDER NAME}: {FOLDER NAME} 을 생성하여 복제.
'개발 관련 > Git & GitHub' 카테고리의 다른 글
[Git] ! [rejected] master -> master (non-fast-forward) (0) | 2022.12.12 |
---|