앞서 폴더를 만들고 + Git Init 으로 해당 폴더를 초기화 하고 + Remote Repository 를 등록하고 + Remote Repository 의 내용을 Pull 하는 모든 과정을 Git Clone 으로 할수 있음
git clone https://github.com/<repository>.git
# Git Clone with username and token
git clone https://<username>:<token>@github.com/<repository>.git
생성확인
ls -all
cat README.md
Local Branch 조회
git branch
Remote Branch 조회
git branch -r
(Local + Remote) Branch 조회
git branch -a
Branch 생성
git branch <branchname>
Branch 이동
git checkout <branchname>
Branch 생성 + 이동
git checkout -b <branchname>
Branch 생성 (Remote Repository)
git push origin <branchname>
Branch 삭제 (Local Repository)
git branch -d <branchname>
# 확인
git branch -a
Branch 삭제 (Remote Repository)
git push origin --delete <branchname>
Remote Repository 생성하기
• 이름 : branch_project
• Option : README.md, .gitignore (Python)
Local 에 Clone
• 위치 : git_ws 하위
• 생성 확인
Branch 생성 후 이동
• 이름 : branch01, branch02
• 이동 : branch01
• 확인 : Local Branch 목록 (현재 Branch 위치 - branch01)
Branch Push
• Push : branch01, branch02
• 확인 : Remote Branch 목록, GitHub
Local Branch 삭제
• Local Branch 삭제 : branch01
• 확인 : Local Branch 목록 (에러상황 처리 포함)
남은 Local Branch 모두 삭제
• main branch 제외
• 확인 : 전체 Branch 목록
Remote Branch 모두 삭제
• main, HEAD 제외
• 확인 : 전체 Branch 목록 , GitHub