2013年8月20日 星期二

利用git打patch

從 AOSP 這官方source code可看見不少的 diff,可手動利用git來更新手上的BSP
  • git apply patch_name
    這是利用 git diff > patch_name 所產生的patch,所以就用git apply
  • git am patch_name
    這是利用 git format-patch 所產生的patch,所以就用git am

這是 git format-patch 產生的訊息,除了 diff 還有email、date、subject等

ex:
From c20416ca9939b471 Mon Sep 17 00:00:00 2001
From: Kenny <Kenny@google.com>
Date: Tue, 23 Jul 2013 20:10:12 -0700
Subject: [PATCH] Do not initialize xxx too early
$ git  am  patch_name後會出現
Applying:Do not initialize xxx too early

就是Applying: Subject 啦

沒有留言:

張貼留言