https://github.com/igrmk/git-version
Construct a version string from a Git repository
https://github.com/igrmk/git-version
bash git
Last synced: about 2 months ago
JSON representation
Construct a version string from a Git repository
- Host: GitHub
- URL: https://github.com/igrmk/git-version
- Owner: igrmk
- License: mit
- Created: 2021-09-09T01:18:34.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-09-09T01:41:40.000Z (almost 5 years ago)
- Last Synced: 2023-03-05T06:34:26.100Z (over 3 years ago)
- Topics: bash, git
- Language: Shell
- Homepage:
- Size: 1000 Bytes
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Git version
===========
This is a very simple Bash script that constructs a version string from a Git repository according to the rules of Go modules.
https://golang.org/ref/mod#versions
https://golang.org/ref/mod#pseudo-versions
Usage
-----
Copy the script
```bash
curl https://raw.githubusercontent.com/igrmk/git-version/main/describe-version > describe-version
chmod u+x describe-version
```
Use it as you wish
```bash
echo "__version__ = \"$(./describe-version)\"" > _version.py
```