Use the following snippet to print out a list of the commits in your git repository.
git log --no-merges --pretty="format:- %s"This uses the following flags:
- --no-merges - No merge commits will be present in the output.
- --pretty - This will format the output, in this case the subject of the commit message will be output (meaning that only the first line will be printed). There are lots and lots of options for this format in the git documentation.
Running this will produce something like this:
- 130: Uninstalling the warmer module.
- 128: Fixing coding standards issue in the theme.
- 128: Added a template override for the book in print mode.
- 128: Updated the breadcrumb generation for books.Just ready to be copy/pasted into markdown as a list.
I have also found that the above command can be modified in the following way.
git log --oneline --no-merges --pretty="format:- %s" | tac | tail -n 50This reverses the order of the output so that commits appear most recent at the bottom, and then only shows the last 50 commits made, which prevents getting all of the git history in your terminal output.
Add new comment