Git help script to version bump

This script automates the process of committing changes, bumping version numbers, and maintaining a changelog for a given Git repository. The script is interactive, prompting the user to make decisions at each step.

Written on Windows 11

Features

  • Detect and List Changes: Detect and list changed and untracked files in the repository.
  • Interactive Addition of Changes: Interactively add changed files to the staging area.
  • Commit Changes: Commit the staged changes with a user-provided commit message.
  • Push to Remote: Optionally push the commit to the remote repository.
  • Version Bumping: Optionally bump the version (major, minor, or patch) and create a tag.
  • Changelog Update: Update or create a CHANGELOG.md with the changes made, the new version number, and the date.
  • Changelog Commit: Commit the updated CHANGELOG.md.

Requirements

  • Python 3.x

  • GitPython package: Install using pip.

    python -m pip install semver
    
    python -m pip install GitPython
    
  • A local Git repository

Usage

  1. Place the script in an appropriate directory on your machine.
  2. Run the script using a Python interpreter.
    python <script_name>.py
    

Notes

  • Ensure that your working directory is clean or that you are aware of the changes before running the script to avoid unintended commits or tags.
  • The script is interactive and will require user input at multiple steps, so please read the prompts carefully before responding.

References

grinntec/git-helper

Last modified July 21, 2024: update (e2ae86c)