10
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

別のgitリポジトリから取ってきたパッチをgit apply/amしたいとき

Last updated at Posted at 2013-03-19

別のgitリポジトリから持ってきたmbox形式のパッチをapplyで当てるには、--directory=でパッチを当てるディレクトリを指定すると良いみたい。

例。
kernelへのパッチあて

$ git apply --directory=kernel path/to/patch

androidへのパッチあて

$ git apply --directory=android/frameworks/base path/to/patch

applyの代わりにamでも同様に使えます。

$ git am --directory=kernel path/to/patch
$ git am --directory=android/frameworks/base path/to/patch

コミットメッセージやDate,Authorをそのまま残したい場合はamで、そうでない場合はapplyを使うと良いようです。

10
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?