[hellogcc] Re: git使用简介

  • From: 陳韋任 <chenwj@xxxxxxxxxxxxxx>
  • To: hellogcc@xxxxxxxxxxxxx
  • Date: Fri, 21 Oct 2011 18:02:32 +0800

> >   \item 
> > 把补丁作为附件mail给maintainer,Linux内核开发最蛋疼的是Linus要求小补丁作为邮件正文,擦,蛋疼,反正我也不玩儿内核,不管那么多。
> 
> 这里有两个办法
> 1.  git send-mail 可以把patches发出去。我没有用过。
> 2.  手动inline patch到mail。这个需要mail
> client有一些修改。我以thunderbird为例子。 需要在thunderbird
> 中,关闭auto wrapping。 这个会自动把超过76个的字母的行给加上
> 换行。

  GIT 入門可以看 http://www.slideshare.net/littlebtc/git-5528339 。
我拿 QEMU 當例子,QEMU 的 patch 也是作為郵件正文。QEMU 的 patch 要求要有 "Signed-off-by"。

---
$ cat > $HOME/.signoff
Chen Wen-Ren <example@address>
$ git clone git://git.qemu.org/qemu.git a
$ cd a
# 建立新的 branch
$ git checkout -b b # 建立新的 branch
 
... 修改檔案 ...
 
$ git commit -a -m "exec.c: Remove useless comment" # 此訊息會是之後信件的 subject
$ git fetch origin # 
$ git rebase origin
# 產生 patch
$ git format-patch -s origin --stdout > ../b.patch
# 送出 patch
$ mutt -H b.patch
---

-- 
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667

Other related posts: