Skip to main content
  1. Learn center
  2. Software Development
  3. Guides
  4. Git tutorial
  5. Git 사용 방법
  6. Git에서 브랜치를 사용하는 방법
  7. 브랜치로 전환
GuidesSoftware DevelopmentBacklog
Git

Project and code management together.

브랜치로 전환

방금 브랜치를 만들었습니다. 이제 새 커밋을 추가하려면 해당 브랜치로 전환해야 합니다.

git checkout 명령을 사용하여 브랜치 issue1로 전환합니다.

$ git checkout issue1
Switched to branch 'issue1'

이제 기록은 다음과 같습니다.

Current history

-b 옵션을 사용하여 새 브랜치를 만들고 하나의 명령으로 전환합니다.

다음으로 커밋을 추가해 보겠습니다. 아래의 굵은 텍스트를 myfile.txt 파일에 추가합니다.

Anyone can learn Git with this tutorial and Backlog add: Register a change in an index

그리고 변경 사항을 커밋합니다.

$ git add myfile.txt
$ git commit -m "append description of the add command"
[issue1 b2b23c4] append description of the add command
 1 files changed, 1 insertions(+), 0 deletions(-)

이제 기록은 다음과 같습니다.

Current history

Subscribe to our newsletter

Learn with Nulab to bring your best ideas to life