gitメモ

CELinux Forum Japan Technical Jamboreeで、ルネサスの岩松さんから git についてのお話。

ちょうど、前の日に James Morris が俺のパッチを security-testing-2.6 ツリーの next ブランチにマージしたと言ってきたものの、リモートのリポジトリのブランチを手元に持ってくる方法がわからなかったので、これ幸いと質問。

最後のLTの時間までの間にわざわざ資料を作って教えて頂きました。多謝。
キーワードは --track で、手元のブランチが追跡すべきリモートのブランチを指定する事。これで、リモートが更新された時にも git-pull で取ってこれる。

以下は、security-testing-2.6ツリーからnextブランチを引っ張ってくる例

[kaigai@masu repo]$ git-clone git://git.kernel.org/(略)/security-testing-2.6.git
Initialized empty Git repository in /home/kaigai/repo/security-testing-2.6/.git/
remote: Counting objects: 897923, done.
remote: Compressing objects: 100% (161001/161001), done.
remote: Total 897923 (delta 749238), reused 884130 (delta 735518)
Receiving objects: 100% (897923/897923), 218.38 MiB | 2810 KiB/s, done.
Resolving deltas: 100% (749238/749238), done.
Checking out files: 100% (24333/24333), done.
[kaigai@masu repo]$ cd security-testing-2.6
[kaigai@masu security-testing-2.6]$ git-checkout --track -b next origin/next
先ずは普通に git-clone をした後、git-checkout コマンドの -b next で、新しいブランチ(名前: next)を作成する。で、このブランチは origin/next をトラッキング(--track)するという事を指定する。

これで、nextブランチのコピーを手元に持ってこれる。
無事に git-log で自分のパッチがコミットされている事を確認できた。めでたしめでたし。

commit d9250dea3f89fe808a525f08888016b495240ed4
Author: KaiGai Kohei
Date: Thu Aug 28 16:35:57 2008 +0900

SELinux: add boundary support and thread context assignment

The purpose of this patch is to assign per-thread security context
under a constraint. It enables multi-threaded server application
to kick a request handler with its fair security context, and
helps some of userspace object managers to handle user's request.