LoginSignup
4
4

More than 5 years have passed since last update.

以前のバージョンから現在までに変更されたファイルを抜き出す

Posted at

特定ディレクトリ以下のファイルで、以前のバージョンから現在までに変更されたファイルについて、以前のファイルを抽出したい。

特定ディレクトリを src、抽出先ディレクトリを src_old とすると、以下のようなコマンドで可能。

OLD_COMMIT=$1 ; for file in `git diff --name-only $OLD_COMMIT HEAD | grep '^src/'` ; do git archive --prefix=src_old/ $OLD_COMMIT $file | tar -xf - ; done

参照 : http://qiita.com/usamik26/items/560830841525c1efa9f5
(余談ですが、自分で過去に書いた記事を自分で参照すること、よくやります)

4
4
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
4
4