git branch, checkout 옵션 정리

Seung·2022년 2월 22일
  • 최신 원격 저장소 내용으로 업데이트하기
    git remote update

  • 원격 저장소의 branch 확인하기
    git branch -r

  • 원격 저장소 branch 참고하기
    git checkout [원격 저장소의 branch 이름]

    이 기능은 소스를 보고 변경해볼 수 있지만, 변경사항을 commit하거나 Push 할 수 없다.
    만약 다른 branch로 checkout한다면 이 branch는 사라진다.

    You are in 'detached HEAD' state. You can look around, make experimental
    changes and commit them, and you can discard any commits you make in this
    state without impacting any branches by switching back to a branch.

  • 원격 저장소 branch 가져오기
    git branch -t [원격 저장소의 branch 이름]
    원격 저장소의 branch를 가져오면서 해당 branch로 이동한다.
profile
인프라 마스터가 되고 싶어요

0개의 댓글