728x90
- git branch --create-reflog : 브랜치의 참조 로그(reflog)를 생성
- 브랜치에서 수행한 모든 작업의 기록을 보관하는데 사용
- git branch --create-reflog
- git branch --track <remote-branch> <local-branch> : 로컬 브랜치를 원격 브랜치와 연동
- 원격 브랜치의 변경 내용을 추적하고 업데이트할 수 있음
- git branch --track origin/feature-branch feature-branch
- git branch --set-upstream-to=<remote-branch> <local-branch> : 로컬 브랜치를 특정 원격 브랜치와 연결
- git push와 git pull 명령에서 기본 업스트림(upstream) 브랜치로 설정
- git branch --set-upstream-to=origin/feature-branch feature-branch
- git branch --unset-upstream <branch-name> : 로컬 브랜치의 업스트림 설정을 제거
- git branch --unset-upstream feature-branch
위의 예시를 통해 git branch 명령어의 추가적인 옵션 사용법을 확인할 수 있습니다.
각 옵션은 특정 기능에 사용되며, 상황에 맞게 활용할 수 있습니다.
728x90
반응형
'프로그래밍 > git' 카테고리의 다른 글
| git checkout 브랜치 전환 사용법과 설명 (깃 체크아웃) (0) | 2023.05.26 |
|---|---|
| (git branch) 브랜치 사용방법 (10가지 옵션) (0) | 2023.05.25 |
| git revert 모든 옵션과 사용법 (0) | 2023.05.19 |
| git revert 명령어 사용법과 설명 (0) | 2023.05.19 |
| git reset 옵션 설명 및 사용방법 (0) | 2023.05.18 |
댓글