参考网址:http://rg03.wordpress.com/2010/01/20/managing-linux-kernel-sources-using-git/
下面是我写的一个具体例子:
$git clone 'git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git'
该命令获得2.6版本内核的所有版本。
$git remote add xmlinux-2.6.33.2 'git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.33.y.git'
$git fetch xmlinux-2.6.33.2
$git branch --track xminux-2.6.33.2 xmlinux-2.6.33.2/master
现在你本地就有xmlinux-2.6.33.2的分支了
然后你需要在该版本内核上改东西,首先切换到该分支:
$git checkout xmlinux-2.6.33.2
然后在里面改东西,然后提交
$git add .
$git commit -m "your commit"
$ git push origin xmlinux-2.6.33.2:xmlinux-2.6.33.2
现在已经完成对2.6.33.2分支的修改了。