git.kernel.org explained: site structure and practical use
git.kernel.org is the Git hosting service for Linux kernel development. This overview explains the repository list, path scheme, summary, log, tree, and commit views, URL search parameters, and the short URLs referenced by kernel CVEs.
git.kernel.org is kernel.org’s Git server. It hosts Linus Torvalds’ main development branch, the stable kernels, linux-next, hundreds of subsystem and developer trees, as well as tools such as git itself, e2fsprogs or the Linux man pages. The web interface is a customized version of cgit (identified in the footer as cgit 1.3.1-korg). It is read-only: there are no accounts, issues, or pull requests. Kernel development takes place through mailing lists, whose archive is at lore.kernel.org; git.kernel.org shows the result: the commits that maintainers have incorporated into their trees.
Typical reasons to visit include a CVE entry that refers to a kernel commit, determining whether a particular fix is included in a kernel version, or reading an individual source file without cloning the entire repository.
The home page: repository list
The home page lists all public repositories in a table. The grouping follows the file path on the server: each intermediate heading such as pub/scm/fs or pub/scm/linux is a directory, with the repositories listed below it using paths relative to that directory.
The most important groups:
| Group | Content |
|---|---|
pub/scm/linux | Kernel trees: mainline, stable, linux-next, and the personal and subsystem trees of maintainers |
pub/scm/fs | File systems and user-space tools (ext2/3/4, XFS, fscrypt, fsverity) |
pub/scm/libs | Libraries such as libcap, libgpiod, libtraceevent |
pub/scm/git | The Git project itself (git.git) with HTML documentation and man pages |
pub/scm/docs | Documentation sources, including man-pages and the PGP keys of kernel developers (kernel/pgpkeys.git) |
pub/scm/infra | kernel.org infrastructure, such as the cgit fork and the Gitolite server’s transparency logs |
pub/scm/bluetooth, devel, editors | BlueZ, developer tools such as sparse and pahole, Linus Torvalds’ uemacs |
The list is very long because every maintainer with an account can store their own trees under pub/scm/linux/kernel/git/. The search field in the upper right filters the list by name, description, and owner. The search can also be called directly as a URL, for example https://git.kernel.org/?q=xfs.
The path scheme of kernel trees
Kernel repositories follow this pattern:
https://git.kernel.org/pub/scm/linux/kernel/git/<konto>/<repository>.git/
<konto> is the maintainer’s username on kernel.org, not necessarily their full name (akpm is Andrew Morton, acme is Arnaldo Carvalho de Melo). For most questions, three trees are sufficient:
| Tree | Path | Purpose |
|---|---|---|
| Mainline | torvalds/linux.git | Linus Torvalds’ development branch; releases v7.3, v7.4-rc1, and so on are created here |
| Stable | stable/linux.git | Maintained versions with fixes (v7.3.1, v7.3.2 …) and the long-term kernels; one branch per version series, for example linux-7.3.y |
| linux-next | next/linux-next.git | Daily merged state of all subsystem trees for the next merge window |
A fix generally moves through these trees in this order: it first lands in the responsible subsystem’s tree, appears in linux-next, is incorporated into mainline during the merge window by Linus Torvalds via pull request email, and is then backported to the stable branches. The responsible subsystem tree is specified in the MAINTAINERS file in the kernel source code (lines with T: git …).
Repository views
Clicking a repository name opens the summary view. The tab bar above it leads to the other views; a selection field to its left chooses the branch to which all views apply.
In the summary view, the tag block is useful for reading the current version: mainline shows release candidates (v7.3-rc7) and releases (v7.3). The download links generate an archive on request and are therefore not always available; for completed releases, the tarballs at kernel.org or cdn.kernel.org are the intended download source, including PGP signatures.
The clone URLs are at the bottom of the summary view. In addition to https:// and the unencrypted git://, a mirror at Google (kernel.googlesource.com) is listed and provides the same content.
Searching the history
The search field in the log view has a selection field with four modes. Each mode is also available as a URL parameter, allowing searches to be bookmarked or linked in tickets:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?qt=grep&q=CVE
The range v7.3-rc6..v7.3-rc7 directly answers the question, “What changed between two versions?” in the browser. In the stable tree, qt=range&q=v7.3.1..v7.3.2&h=linux-7.3.y shows all fixes added with a stable update.
Reading a commit
An individual commit can be addressed through its full SHA-1 hash:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=<sha>
The view shows the author, committer, date, parent commit (parent), complete commit message, and diff. At the end of a kernel commit message are trailers such as Signed-off-by:, Reviewed-by:, and Fixes: <sha> ("Titel"). The Fixes: line identifies the commit that introduced the bug; this can be used to determine from which version a system is affected. Link: usually refers to the related discussion on lore.kernel.org, while Cc: stable@vger.kernel.org marks the fix for backporting to stable kernels.
If commit in the URL is replaced with patch, the server returns the commit as a patch file in mail format (text/plain), which can be applied with git am or patch.
Short URLs in CVE entries
Since the kernel project itself began assigning CVE numbers, entries in the CVE list and NVD refer to short URLs in the form https://git.kernel.org/stable/c/<sha>. git.kernel.org redirects these via HTTP 301 to the commit view in the appropriate tree:
| Short URL | Destination |
|---|---|
https://git.kernel.org/stable/c/<sha> | Commit in the stable tree stable/linux.git |
https://git.kernel.org/linus/<sha> | Commit in mainline torvalds/linux.git |
A CVE entry generally lists several such links: one for each stable branch to which the fix was backported, and one for mainline. The hashes differ because each backport is its own commit. The backport’s commit message identifies the hash of the original in mainline, either as a commit <sha> upstream. line or as [ Upstream commit <sha> ].
Checking whether a fix is included in a version
The web interface does not show which tags contain a commit. A local clone is required for that. For this purpose, a clone without file contents that downloads only the commit history is sufficient:
git clone --filter=blob:none --no-checkout https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Then, a command in the cloned directory answers the question of the first version containing the fix:
git describe --contains <sha>
The output takes the form v7.3.2~14: the fix is included starting with v7.3.2. git tag --contains <sha> lists all tags containing the commit. If only an individual file or a revision is needed for reading, the tree and plain views can be used in the browser instead of a clone.
For the full source code for building, a shallow clone of a tag is sufficient:
git clone --depth 1 --branch v7.3 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Tracking changes
Every repository provides an Atom feed for the default branch at …/<repository>.git/atom/, and for mainline this is https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/atom/. A feed reader can therefore display new commits without requiring regular visits to the page. During the merge window, the mainline feed generates many entries per day; for releases and stable updates, the version overview at kernel.org or its feed is the quieter source.
Comments
Comments are loaded from GitHub / Giscus.