블로그 이미지
윤영식
Full Stacker, Application Architecter, KnowHow Dispenser and Bike Rider

Publication

Category

Recent Post

2012. 12. 20. 16:01 Git, GitHub/Git Lec01

Git의 tag는 코드의 책깔피와 같아서 릴리즈된 코드에 tag를 달아두면 언제나 해당 태그로 이동할 수 있다. 즉, Freezing Code Release 정도로 보면 되겠다. Tag 는 브랜치처럼 다루어 지지만 읽기만 가능하다. 따라서 변경을 하고 태그로 부터 별도 브랜치를 생성하여 진행하면 된다. 


// 현재 상태 

$ git branch

* master


// 태그 생성

$ git tag 1.0


// 태그 목록 

$ git tag

1.0


// 태그로 이동 : 태그로 이동하면 마치 주인없는 땅으로 이동한 것과 같다 

$ git checkout 1.0

Note: checking out '1.0'.


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 performing another checkout.


If you want to create a new branch to retain commits you create, you may

do so (now or later) by using -b with the checkout command again. Example:


  git checkout -b new_branch_name


HEAD is now at f5844d4... add license.properties


// no branch라고 나온다 

$ git branch

* (no branch)

  master


// 태그에서 별도의 브랜치를 생성하여 write 작업을 할 수 있다 

$ git checkout -b from-1.0

Switched to a new branch 'from-1.0'


// 전체 브랜치 목록

$ git branch

* from-1.0

  master


// 태그 1.0 에서 또 다른 브랜치 생성

$ git checkout -b another-from-1.0 1.0

Switched to a new branch 'another-from-1.0'


// 전체 브랜치 목록

$ git branch

* another-from-1.0

  from-1.0

  master


릴리즈 버전에 대하여 코드 freezing 시에 사용하자 

posted by 윤영식