Kernel Hackers Guide to git (v3)
来源:互联网 发布:js获取页面点击次数 编辑:程序博客网 时间:2024/06/06 09:39
From: Jeff Garzik (jgarzik_at_pobox.com)
Date: 06/25/05
- Previous message: David Masover: "Re: reiser4 plugins"
- Next in thread: Toufeeq Hussain: "Re: Kernel Hackers Guide to git (v3)"
- Reply: Toufeeq Hussain: "Re: Kernel Hackers Guide to git (v3)"
- Reply: Valdis.Kletnieks_at_vt.edu: "Re: Kernel Hackers Guide to git (v3)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date:Sat, 25 Jun 2005 01:13:46 -0400To: Linux Kernel <linux-kernel@vger.kernel.org>
See attached.
An HTML version is also available at http://linux.yyz.us/git-howto.html
Jeff
Kernel Hackers' Guide to git
1) installing git
git requires bootstrapping, since you must have git installed in order
to check out git.git (git repo), and linux-2.6.git (kernel repo). I
have put together a bootstrap tarball of a recent git repository.
Download tarball from:
http://www.kernel.org/pub/linux/kernel/people/jgarzik/git-20050622.tar.bz2
tarball build-deps: zlib, libcurl, libcrypto (openssl)
install tarball: unpack && make && sudo make prefix=/usr/local install
jgarzik helper scripts, not in official git distribution:
http://www.kernel.org/pub/linux/kernel/people/jgarzik/git-new-branch
http://www.kernel.org/pub/linux/kernel/people/jgarzik/git-changes-script
After reading the rest of this document, come back and update your copy
of git to the latest:
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/git.git
2) download a linux kernel tree for the very first time
$ git clone /
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git /
linux-2.6
$ cd linux-2.6
$ rsync -a --delete --verbose --stats --progress /
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git/ /
.git/
NOTE: The kernel tree is very large. This constitutes downloading
several hundred megabytes of data.
3) update local kernel tree to latest 2.6.x upstream ("fast-forward merge")
$ cd linux-2.6
$ git-pull-script /
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
4) check out files from the git repository into the working directory
$ git checkout -f
5) check in your own modifications (e.g. do some hacking, or apply a
patch)
# go to repo
$ cd linux-2.6
# make some modifications
$ vi drivers/net/sk98lin/skdim.c
# NOTE: add '--add' and/or '--remove' if files were added or removed
$ git-update-cache <list of all files changed>
# check in changes
$ git commit
6) List all changes in working dir, in diff format.
$ git diff
7) Obtain summary of all changes in working dir
$ git status
8) List all changesets (i.e. show each cset's description text) in local
branch of local tree, that are not present in remote tree.
$ cd my-kernel-tree-2.6
$ git-changes-script -L ../linux-2.6 | less
9) List all changesets:
$ git log
10) apply all patches in a Berkeley mbox-format file
First, download and add to your PATH Linus's git tools:
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/git-tools.git
$ cd my-kernel-tree-2.6
$ dotest /path/to/mbox # yes, Linus has no taste in naming scripts
11) don't forget to download tags from time to time.
git-pull-script only downloads sha1-indexed object data, and the
requested remote head. This misses updates to the .git/refs/tags/ and
.git/refs/heads directories. It is advisable to update your kernel .git
directories periodically with a full rsync command, to make sure you got
everything:
$ cd linux-2.6
$ rsync -a --delete --verbose --stats --progress /
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git/ /
.git/
12) list all branches
$ ls .git/refs/heads/
13) make desired branch current in working directory
$ git checkout -f $branch
14) create a new branch, and make it current
$ cp .git/refs/heads/master .git/refs/heads/my-new-branch-name
$ git checkout -f my-new-branch-name
15) examine which branch is current
$ ls -l .git/HEAD
16) undo all local modifications (same as checkout):
$ git checkout -f
17) obtain a diff between current branch, and master branch
In most trees WITH BRANCHES, .git/refs/heads/master contains the current
'vanilla' upstream tree, for easy diffing and merging. (in trees
without branches, 'master' simply contains your latest changes)
$ git diff master..HEAD
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Kernel Hackers Guide to git (v3)
- Kernel Hackers' Guide to git
- kernel hacker’s guide to git
- Hackers Beware: The Ultimate Guide to Network Security
- Hackers Beware: The Ultimate Guide to Network Security by Eric Cole
- [转载]Kernel Locking中文版 Unreliable Guide To Locking
- The Newbies Guide to Compiling Your First Kernel
- hackers
- Git guide
- git guide
- the definitive guide for hackers, virus coders and system administrators
- Simple guide to forks in GitHub and Git
- Simple guide to forks in GitHub and Git文章翻译
- cocos2dx Programmers guide v3.12
- How to git clone linux kernel for developer(THE URL)
- Linux Kernel Reading Guide - Configuring the Kernel
- Gentoo Linux Kernel Upgrade Guide
- Cocos2d-x Programmers Guide v3.12
- ajax 调用 servlet问题
- 中秋的饺子、关于做饭和表达
- Jquery插件:autoTip
- 回顾与展望
- ASP.NET视图页面使用标记语法
- Kernel Hackers Guide to git (v3)
- 读书笔记之编程之美 - 4.6 桶中取黑白球
- 喜庆的中秋。悲哀的我
- 最近正在做《高级Qt编程--使用C++和Qt创建卓越软件》一书的审校,比较忙。所以写博客较少。顺便透露一下进度。呵呵
- gae更新实体
- 不显示删除回复显示所有回复显示星级回复显示得分回复 [推荐] win7的10个技巧
- 中秋之月
- 硬盘变为raw格式时怎么办?
- 使用git参与kernel开发