Last active
May 6, 2022 21:06
-
-
Save stolarczyk/a905a90aaa705f31416db9504886bca4 to your computer and use it in GitHub Desktop.
Revisions
-
stolarczyk revised this gist
May 6, 2022 . 1 changed file with 15 additions and 12 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,23 +4,26 @@ This script saves Git commits to a CSV file. ## Usage 1. Download the file 2. Make the file executable ```console chmod +x commits2csv.sh ``` 3. Run in the repository. Pass a date since when the commits should be listed. The argument is required. ```console ./commits2csv.sh <since_date> ``` The required date format is: `YYY-MM-DD`. For example: ```console ./commits2csv.sh 2022-05-05 ``` ## Output -
stolarczyk created this gist
May 6, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ # Save GitHub commits as CSV This script saves Git commits to a CSV file. ## Usage Make the file executable ```console chmod +x commits2csv.sh ``` Run in the repository. Pass a date since when the commits should be listed. The argument is required. The format is: `YYY-MM-DD`. ```console ./commits2csv.sh <since_date> ``` For example: ```console ./commits2csv.sh 2022-05-05 ``` ## Output The commits will be saved in the current working directory in: `commits-<since_date>.csv`. For example: `commits-2022-05-05.csv` ```console <date>,<author_name>,<commit_message> <date>,<author_name>,<commit_message> <date>,<author_name>,<commit_message> <date>,<author_name>,<commit_message> ... ``` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ #!/usr/bin/env bash if [ -z "$1" ]; then echo "Usage: $0 <since_date>, e.g. $0 2022-05-05" exit 1 fi git log --after=$1 --pretty=format:%as,%an,%s > commits-$1.csv