linux-next 树是针对下一个内核合并窗口的补丁的暂存区。如果你正在进行尖端的内核开发,你可能希望从该树而不是 Linus Torvalds 的主线树进行工作。
如果你尚未这样做,请首先克隆一份 主线 Linux Git 仓库
$ git clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
# or: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Cloning into 'linux'...
...
然后为 linux-next 添加一个远程跟踪分支
$ cd linux
$ git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
# or: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
获取 linux-next 以及标签
$ git fetch linux-next
...
$ git fetch --tags linux-next
...
更新 linux-next
$ git checkout master # to be safe
...
$ git remote update
...
列出(最近的)linux-next 标签
$ git tag -l "next-*" | tail
next-20140612
next-20140613
next-20140616
next-20140617
next-20140618
next-20140619
next-20140620
next-20140623
next-20140624
next-20140625
选择你将要工作的 linux-next 版本,并基于该版本创建一个本地分支
$ git checkout -b my_local_branch next-20140625
Switched to a new branch 'my_local_branch'