Current version
Git/Latestdiff: 1.5.6
Latest Snapshots
Produced after each commit or rebase to new upstream version
GIT
RSBAC source code, can be unstable sometimes
No events planned
This is an old revision of the document!
Git is the version tracking system used by the Linux kernel and increasingly many others. Why?
A simple example: The current rsbac-2.6 svn/svk repository is 1.2G, the same git repository is 367M.
Comming from SVN, SVK? Forget about the classical file structure. Git is fully distributed, thus every repository is your own. When you push your changes upstream, you are sending your differences for inclusion, you are not synchronizing with upstream. That's the difference.
Also: there are no trunk, tags, branches directories. Only branches! Tags are special commits which are immutable, included in the branches. They are not standalone branches.
Branches can be merged to each other. In fact, git is made to do that all the time.
Every commit is marked with a unique SHA1 sum. When you merge, common ancestors (identical SHA1 sum) are found, no matter which branch you are using, Linus tree, RSBAC tree, your friend tree.. if there's common ancestors they will be found and used!
The default branch is usually called master
(instead of trunk
) but not necessarily.
Defaults for commits:
# git config --global user.name "FirstName LastName" # git config --global user.email "user@example.com"
Enable coloring (recommended):
# git config --global color.ui "auto"
Enable multi-core CPU detection:
# git config --global pack.threads "0"
Enable maximum memory usage limit (recommended for systems with 2G+ of RAM):
# git config --global diff.renamelimit "0"
(As developper)
# git clone ssh://rsbac.org/daten/git/linux-2.6.git
(Anonymous)
# git clone http://git.rsbac.org/linux-2.6 # git clone git://rsbac.org/linux-2.6
Note that this gives you the same repository, but setup your git config file differently, so developers can push their changes by default via SSH. git:
.
is faster than
http:
# git branch -a
[…]
remotes/origin/rsbac-1.4-2.6.33 # git checkout -b rsbac-1.4-2.6.33 origin/rsbac-1.4-2.6.33
This updates the 2.6.33 kernel "stable" branch # git pull ssh://rsbac.org/daten/git/linux-2.6.git rsbac-1.4-2.6.33
This updates the master "unstable" branch (this will take both Linus tree changes and RSBAC changes) # git pull ssh://rsbac.org/daten/git/linux-2.6.git master
Update the master with changes from Linus's Linux tree (=latest possible Linux kernel) # git pull git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
I suggest you install a merge tool, like vimdiff, meld, or kdiff.
# git mergetool
When solving, make sure you have a new line between RSBAC code and kernel code. This will allow future changes to be auto-merged more easily when possible.
Use a GUI log browser! For example: gitk or gitg, but there are many others.
This gives you a local version of “git web” basically.
Speaking of which, another must have the linux-2.6 master git web interface:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=summary
And the RSBAC one:
# git remote add upstream git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git # git fetch upstream # // You can now address this branch as upstream/master for diffs and merges
Get the tags from the stable git repos:
# git fetch -t git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.33.y.git
And just diff it:
# git diff v2.6.33.2
Or diff with a RSBAC tag (to create a patch for one kernel version):
# git diff v2.6.33.2 v2.6.33.2-rsbac-1.4.4
# git tag -a my_tag_name
git is a bit stupid about tag signing. Yeah, really. If you use for example, kang@rsbac.org as your git commit email, you need to own a default primary gpg key with that email. If like me, you do not have that, but instead, kang@rsbac.org is an alias for another primary gpg key (=another email), you have to tell git or it won't find out, and it will look like your missing your private key while you're really not.
# git tag -u kang@rsbac.org -s my_tag_name
While this should not happen, it could be that you commit a non-RSBAC group of files in the Linux tree, which will break “fast forward” merging and conflict on non-RSBAC committed files while pulling from the Linux upstream (linux-2.6.git).
In that case, there is a solution:
:wqa
or the script will stop, just use :w
then :qa
- commit