git am
git
書き方
git am [-3] <mbox|patch>...メールで届いたパッチを、元の作者とメッセージのままコミットにします。途中で失敗するとそこで止まるので、--continue・--skip・--abortで決着させます。
よく使うオプション
| オプション | 意味 |
|---|---|
| -3 | three-way merge when the patch does not apply cleanly |
| -s | add a Signed-off-by line |
| --continue | go on after you fixed the conflict |
| --skip | drop this patch and continue the series |
| --abort | undo the whole series |
| -k | keep the subject line exactly as it is |
例
git am 0001-fix-login.patchcommits the patch, keeping its original author
git am -3 *.patchapplies a whole series, merging where needed
git am --abortreturns to before the series started
取り消しに何通りもあるのが混乱のもとです — ブランチの指す先を動かすのと、打ち消すコミットを積むのは別です。
読み方
- 角括弧 [ ] は省いてよい部分です。
- 三点 … は複数並べられるという意味です。
- オプションは大文字小文字を区別します — -r と -R が別物のコマンドもあります。
よくある質問
Q. git am は何をしますか。
メールで届いたパッチを、元の作者とメッセージのままコミットにします。途中で失敗するとそこで止まるので、--continue・--skip・--abortで決着させます。
Q. どう打ちますか。
git am [-3] <mbox|patch>... — 角括弧は省いてよい部分です。
Q. よく使うオプションはいくつですか。
ここにまとめたのは6個です。全部は man git にあります。このコマンドはgitの仲間です。
関連するコマンド
man ページ: man git-am