Last active
August 5, 2024 15:47
-
-
Save dolmen/d5cd5d8c2dc218a7557571868d6f1827 to your computer and use it in GitHub Desktop.
Git aliases for Go developement #golang #git
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# git go-version: shows the Go-modules versionning formatting of a Git commit | |
git config --global alias.go-version '!f(){ cd -- "${GIT_PREFIX:-.}"; TZ=UTC git log -1 '\''--date=format-local:%Y%m%d%H%M%S'\'' --abbrev=12 '\''--pretty=tformat:v0.0.0-%cd-%h'\'' "$@" ;};f' | |
# git go-get: shows the command to run on another Go project to upgrade this module | |
git config --global alias.go-get '!f(){ cd -- "${GIT_PREFIX:-.}"; TZ=UTC git log -1 '\''--date=format-local:%Y%m%d%H%M%S'\'' --abbrev=12 '\''--pretty=tformat:go get '\''"$(go list -m)"'\''@v0.0.0-%cd-%h'\'' "$@" ;};f' | |
# git go-shortlog: shows the 10 commits in Go-modules versionning style | |
git config --global alias.go-shortlog '!f(){ cd -- "${GIT_PREFIX:-.}"; TZ=UTC git log -10 '\''--date=format-local:%Y%m%d%H%M%S'\'' --abbrev=12 '\''--pretty=tformat:v0.0.0-%cd-%h %s'\'' "$@" ;};f' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment