Stack/Git

[Git] branch 명령어

annovation 2025. 1. 27. 08:47

branch 

 

1. 생성

  • 원하는 이름으로 브랜치를 만듭니다. 여기서는 브랜치 이름을 "new-feature"로 지정합니다.
git branch new-feature

 

2. 이동

 

(1) 새 branch로 이동만 하는 경우

  • 이제 다음 명령을 사용하여 현재 브랜치에서 새 기능 브랜치로 이동합니다.
git chechout new-feature

 

(2) branch 생성 및 이동 하는 경우

git checkout -b new-feature

 

 

3. 현재 branch 확인

  • 다음 명령을 실행하여 현재 진행 중인 branch를 확인하세요.
git branch

 

4. 삭제

  • 삭제하려는 브랜치에 있는지 확인 후 실행합니다.
git branch -d 삭제할-branch-name

출처

1. OpenAI ChatGPT https://openai.com

2. Geeksforgeeks : https://www.geeksforgeeks.org/branching-strategies-in-git/

 

Branching strategies In Git - GeeksforGeeks

A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.

www.geeksforgeeks.org

 

 

'Stack > Git' 카테고리의 다른 글

[Git] 협업 프로젝트 개인 레포 fork 해서 리팩토링하기!  (0) 2025.12.03
[Git] main으로 branch merge  (0) 2025.01.28
[GitHub] PR template  (0) 2025.01.26
[Git] Commit Message  (0) 2025.01.25
[Git] Git workflow 브랜치 전략  (1) 2025.01.24