개발 관련/Git
[Git] git 명령어
domo7304
2021. 8. 2. 14:31
변경된 모든 파일 스테이징
$ git add .
현재 상태 조회
$ git status
스테이징한 내용 commit
$ git commit -m "커밋메시지"
commit 내용 push
$ git push <branch>
브랜치 생성하기
$ git branch <new branch> <from_branch>
브랜치 이름 변경
$ git branch -m <branch> <new branch>
등록된 브랜치 확인, 현재 브랜치 확인
$ git branch -v
브랜치 전환하기
$ git checkout <branch>
브랜치의 추적 확인 (브랜치가 향하고 있는 원격 브랜치 확인)
$ git branch -vv
추적 브랜치 설정
$ git branch --set-upstream-to <branch>
추적 브랜치 해제
$ git branch --unset-upstream
remote repository 확인
$ git remote -v
remote repository 등록
$ git remote add upstream <url>
upstream으로부터 fetch
$ git fetch upstream
브랜치 합병
$ git merge <branch> (ex. upstream/main)
브랜치 분기, 이동 (두 명령어를 합친 것)
$ git checkout -b <branch> ($ git branch <new branch> <from branch> + $ git checkout <branch> )