Re: [問題] Git使用問題
※ 引述《final01 (牛頓運動定律)》之銘言:
: 想請問一下例如:http://gitorious.org/usb/usb
: 有很多branch
: 要怎麼下載裏面的branch呢??
: 我想要用git下載(這網頁好像可以幫你打包)
: 感覺git未免太複雜了吧
: 感謝!!
git clone 就會把所有的 commit 給弄下來
然後你再用 git branch -a 看一下
然後 git branch <local_branch_name> origin/<remote_branch_name>
這樣你就可以有你要的 branch 了
Ex: 我想玩看看 Ubuntu Karmic EC2 kernel
# git clone git://kernel.ubuntu.com/ubuntu/ubuntu-karmic.git
.....
# cd ubuntu-karmic
# git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/arm
remotes/origin/ec2
remotes/origin/fsl-imx51
remotes/origin/master
remotes/origin/mvl-dove
remotes/origin/netbook
remotes/origin/patches-that-need-love
remotes/origin/pending-upstream-patches
# git branch my_ec2 origin/ec2
Branch my_ec2 set up to track remote branch ec2 from origin.
# git checkout my_ec2
Switched to branch 'my_ec2'
要注意的是, 接下來你如果想 rebase 的話, 請下
git fetch origin
git rebase origin/ec2 <- 不是用習慣的 origin/master
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 210.242.151.101
→
01/22 14:30, , 1F
01/22 14:30, 1F
討論串 (同標題文章)