Skip to content

About

Export git commit history to a text file, with optional diffs, tag filtering, and date/author filters. Great for generating changelogs with AI — just export and paste into your favorite LLM.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

git_export_commits

A bash script that exports your git commit history to a text file, with optional diffs.

Installation

mv export_commits ~/.local/bin/export_commits
chmod +x ~/.local/bin/export_commits

If ~/.local/bin is not on your PATH, add this to your ~/.bashrc or ~/.zshrc:

export PATH="$HOME/.local/bin:$PATH"

Then reload your shell:

source ~/.zshrc   # or ~/.bashrc

Usage

export_commits [OPTIONS]

Run from inside any git repository. The output file is created in the current directory.

Options

Flag Description
-d, --diff Include full diffs for each commit
--no-author Omit author name and email from output
--from TAG Export commits starting after this tag
--to TAG Export commits up to and including this tag
-o FILE Output file (default: commits.txt)
-b BRANCH Branch to export (default: current branch)
-n N Limit to the last N commits
-a AUTHOR Filter commits by author name or email
-s DATE Only commits after this date (e.g. 2024-01-01)
-u DATE Only commits before this date
-h, --help Show help message

Examples

# All commits, basic log
export_commits

# All commits with diffs
export_commits --diff

# All commits, no author, with diffs
export_commits --no-author --diff

# Last 20 commits, saved to a custom file
export_commits -n 20 -o my_log.txt

# Commits from a specific author since a date
export_commits -a "jane@example.com" -s 2024-01-01

# Specific branch, with diffs, no author
export_commits -b main --diff --no-author -o main_log.txt

# Commits between two tags
export_commits --from v1.0.0 --to v2.0.0

# Commits between two tags, with diffs, no author
export_commits --from v1.0.0 --to v2.0.0 --diff --no-author

# All commits after a tag up to HEAD
export_commits --from v1.0.0

Output

Each commit entry contains:

  • Full and short commit hash
  • Author name and email (unless --no-author is used)
  • Date
  • Subject and body
  • Tags pointing to the commit (shows — if none)
  • List of changed files
  • Full diff (if --diff is used)

About

Export git commit history to a text file, with optional diffs, tag filtering, and date/author filters. Great for generating changelogs with AI — just export and paste into your favorite LLM.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages