Handling Linux Kernel Repository on Windows

The following outlines steps on how to deal with[1][2] Linux Kernel’s repository on a Windows system. This content will handle the case of dealing from a clean clone or a Linux Kernel bundle (git bundle create kernel.bundle --all; from a Linux source) and using a temporary repository on a Windows-based system to push content to another Git repository.

Prerequisites

  • Windows System with Git Installed

Steps

Clean source

Open up Git Bash and perform a no-checkout clone in a directory of your choosing:

$ git clone --no-checkout git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git

Rename the origin branch to official:

$ git remote rename origin official

Setup a sparse checkout environment (to prevent case sensitive file system issues):

$ git config core.sparsecheckout true
$ echo drivers/usb/misc/* >.git/info/sparse-checkout

View the branches you have available and checkout what you want:

$ git branch -a
...
$ git checkout <branch>

Add your new origin remote and push up all your branches:

$ git remote add origin <new origin>
$ git push --all origin

Bundle source

Open up Git Bash and initialize a new repository in a directory of your choosing:

$ git init

Add the bundle as a remote (we will name the remote usb):

$ git remote add usb <path>/kernel.bundle

Fetch your bundle’s content:

$ git fetch --all

Setup a sparse checkout environment (to prevent case sensitive file system issues):

$ git config core.sparsecheckout true
$ echo drivers/usb/misc/* >.git/info/sparse-checkout

View the branches you have available and checkout what you want:

$ git branch -a
...
$ git checkout <branch>

Add your new origin remote and push up all your branches:

$ git remote add origin <new origin>
$ git push --all origin