git cherry-pick : 特定のcommitをマージする

git checkout dev
git log

commit cbd071da2516d91a2479716ff8c3b92a7f5f1c27
Author: Junichi Otake <@gmail.com>
Date: Mon May 27 17:51:42 2013 +0900

fix preall init

とこのコミットだけをmasterに反映する

git checkout master
git cherry-pick cbd071da2516d91a2479716ff8c3b92a7f5f1c27
commit 43eb3799f961e762b691d26f92ff259b5111e18d
Author: Junichi Otake <@gmail.com>
Date: Mon May 27 17:51:42 2013 +0900

fix preall init

diff –git a/view/sp/scripts/sample/result.php b/view/sp/scripts/
index a70c85e..51def8a 100644
— a/view/sp/scripts/sample/result.php
+++ b/view/sp/scripts/sample/result.php
@@ -10,6 +10,7 @@

+ $preall = -1;

こんな感じで新しくコミットされました。

=======

コミットされるとあれなので、まずは、コミットせず変更を反映するには -n

例えば、こんなとき、一つのファイルの変更だけ利用したいので、 -nで反映してみます。

commit a537f55352f3aac3f4a67a2d0ffe96cb14d84400
Author: Junichi Otake <@gmail.com>
Date: Mon May 27 17:58:09 2013 +0900

v2.4.2 update header

fabfile.py | 2 +-
view/sp/scripts/game/header.php | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

ステージングされているので
git reset
して、
入らない変更を戻して、
git checkout fabfile.py
してという感じです。

This entry was posted on 水曜日, 5月 29th, 2013 at 6:03 AM and is filed under git. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Unityによるゲームを公開しております iOS/Android
https://itunes.apple.com/jp/app/lost-knight-3d-action/id900917032
https://play.google.com/store/apps/details?id=com.groundroad.runknight

各種開発支援・機能開発等小さいお仕事などもお請けしております。
unity開発支援, PHPシステム開発, javascript/html5 フロント開発, titanium mobileアプリ開発
お気軽にお問い合わせください
大崎・五反田近郊での対面でのお打ち合わせはいつでも可能です。