기술 기록/git
git) CLI branch 정리
Fola
2023. 1. 19. 21:25
1. branch 생성
git branch <브랜치이름>
2. branch 목록 확인
git branch
3. checkout (이동)
git checkout <브랜치이름>
4. merge (병합)
git checkout <베이스 브랜치(main)>
git merge <작업 브랜치>
결과:
<베이스 브랜치(main)>에 <작업 브랜치>의 변경 사항이 반영된다
5. Delete branch
git branch -d <branchName>
6. Rename branch
git branch -m <old-branch-name> <new-branch-name>
- After then. This command make rename on remote repository as well
git push origin :<old-branch-name> <new-branch-name>
* 변경/추가 이력
2022-04-22: 1번~4번 작성
2023-01-19: 5번~6번 작성