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'