星期一, 8月 20, 2012

[git] tag checkout memo

Checkout a repository into your Github: (we fork yui3 into our github)
git@github.com:miiicasa/yui3.git

Checkout to your local repository.
git checkout git@github.com:miiicasa/yui3.git somefolder
or
git submodule add git@github.com:miiicasa/yui3.git somefolder

List all tag (go to somefolder):
git tag -l

Checkout tag:
git checkout "v3.6.0"

It will info you that the repository was detached from master.
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:

Checkout as a branch:
git checkout -b "v3.6.0"

沒有留言: