How to regenerate changelog using standard-version

How to regenerate changelog using standard-version

I had a very short project (a dozen commits) which I wanted to convert to use conventional commits. Let me describe this non-conventional procedure I had to follow.


I wrote an introduction to conventional commits and standard-version in the previous post:


The first step was editing all commit messages to align them with the convention (git rebase -i <first commit>).

Next, I moved all existing tags to the new commits. After editing the messages, the history was rewritten and new commits were created. Thus, the existing tags pointed to old commits. I had to point them to the corresponding new commits, which was quite tedious, as for every tag I had to issue the command:

git tag -f <new version> <new hash>
e.g. git tag -f v1.0.2 fc32ca5


I added the standard-version package to the project and created the release script:


Because that project will not have many changes, I decided to include a full log by using the full .versionrc template.

Generate changes

There are command-line switches for standard-version that disable any steps. As I wanted to only generate the changelog without bumping version, committing or tagging, I tried to run:

npm run release -- --skip.bump --skip.tag --skip.commit

The file was created, but it only contained a header. I tried jumping through the git history to the tag versions or before the versions and generate the log in parts, but that also failed. Finally, I debugged the standard-version script and I found that internally it used an option called releaseCount that allowed to process more than the most recent version tag. Unfortunately, passing --releaseCount=0, --releaseCount=4, --release-count=4 etc. did not have any effect.

The releaseCount option is used in the following context:


To stop wasting more time, I temporarily changed fromTag to:

fromTag = gitSemverTags[gitSemverTags.length - 1]

and generated the changelog again:

npm run release -- --skip.bump --skip.tag --skip.commit

Now the file contained all changes from all versions.

Well, almost all – except for the first version. To overcome this, I added a tag to the very first commit in my history:

git tag v0.0.0 dc49d7f

After removing the file and running the npm command again, I had a full log from the beginning. You can see the result in

Leave a Reply

Notify of