3# Parse command line arguments
5while [ "$#" -gt 0 ]; do
7 --minor) minor=true; shift 1;;
8 *) echo "Unknown parameter: $1"; exit 1;;
12git fetch --force --tags
14# Get the latest Git tag
15latest_tag=$(git tag --sort=committerdate | grep -E '[0-9]' | tail -1)
17# If there is no tag, exit the script
18if [ -z "$latest_tag" ]; then
23echo "Latest tag: $latest_tag"
25# Split the tag into major, minor, and patch numbers
26IFS='.' read -ra VERSION <<< "$latest_tag"
28if [ "$minor" = true ]; then
29 # Increment the minor version and reset patch to 0
30 minor_number=${VERSION[1]}
32 new_version="${VERSION[0]}.$minor_number.0"
34 # Increment the patch version
35 patch_number=${VERSION[2]}
37 new_version="${VERSION[0]}.${VERSION[1]}.$patch_number"
40echo "New version: $new_version"
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list