From 2bc4a0ded80c3036bc6b6b36d564f6b47c3a75dc Mon Sep 17 00:00:00 2001 From: wuqi Date: Mon, 13 May 2024 11:15:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0git=20archive?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .rc.func.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.rc.func.sh b/.rc.func.sh index 8117b7b..64df541 100644 --- a/.rc.func.sh +++ b/.rc.func.sh @@ -102,3 +102,9 @@ function switchpy() { fi done } + +function gitarchive() { + first=`git log -1 --pretty=oneline | cut -d ' ' -f 1 | tail -n 1` + second=`git log -2 --pretty=oneline | cut -d ' ' -f 1 | tail -n 1` + git archive -o $1 $first $(git diff --name-only $second $first) +}