Sort Git Tags by Ascending and Descending Semver
Semver is a popular way of versioning applications and software libraries. However, if you use git tag
to list out all your tagged versions of a Git repository you’ll probably find the tags returned are not listed in the expected order. That’s because by default Git uses lexicographic order, also known as dictionary or alphabetical order. Therefore, 1.10.0
will come before 1.2.0
when listing the tags in ascending order.
Auto-Correct Git Commands
Did you know that if you mistype a Git command you can automatically run the suggested fix? I’ve been using Git for many years now and only just come across this feature today. To enable it you need to assign a value to the config setting help.autocorrect
.
Automating NPM and Composer with Git Hooks
A look at automating NPM and Composer when checking out new branches and pulling from a remote Git repository using Git hooks.
Automatically Prefixing Git Commit Messages with an Issue Number From the Current Branch Name
Using Git hooks to encourage a branch naming convention and inject an issue number in commit messages using the current branch name.