2011年4月14日 星期四

checkout remote branch , merge then update it.

看一下 remote 的 branch
$git branch -r
korg/master
korg/my9.1
korg/release-1.0
korg/rtk

checkout 出 remote 要merge 的 branch
$git checkout rtk
Branch rtk set up to track remote branch rtk from korg.
Switched to a new branch 'rtk'

這個動作很奇怪,如果原來就有一個 branch 叫 rtk 呢?他怎摩區分我是要 checkout remote 端的 rtk branch, 還是要 checkout 原來的 local rtk branch ?

接著 merge 到我的 code:
$git merge mytest
然後就可以 push 回 remote
$git push
都不用指定remote name...

沒有留言:

張貼留言