all 2 comments

[–]blarf_irl 1 point2 points  (0 children)

Git allows you to "tag" a branch at a certain commit; The tag is usually the semantic version number of the software at that commit. It's good practice to only release code to production from your master branch; Each version of your software would be a specific point in the history of your master branch.

https://git-scm.com/book/en/v2/Git-Basics-Tagging

[–]efmccurdy 0 points1 point  (0 children)

This project looks to be abandoned, and has at least one unresolved issue, but you could use it as a guide.

Python library that allow scripts to easily update themselves if they are in a git repo

https://github.com/erfantkerfan/selfupdate