repositorypackage
1.0.7
Repository: https://github.com/afeiship/go-gitinfo.git
Documentation: pkg.go.dev
# README
go-gitinfo
Gitinfo for golang.
installation
go get -u github.com/afeiship/go-gitinfo
usage
package main
import (
"fmt"
"github.com/afeiship/go-gitinfo"
)
func main() {
info := gitinfo.GetGitInfo()
fmt.Println(info)
}
{
"name": "afeiship",
"email": "[email protected]",
"current_branch": "main",
"hash": "bd457285054d8f95f9d4b4840c76873b5d549569",
"short_hash": "bd45728",
"meta": {
"original_url": "[email protected]:afeiship/go-gitinfo.git",
"protocol": "https",
"hostname": "github.com",
"owner": "afeiship",
"repo": "go-gitinfo",
"ssh_url": "[email protected]:afeiship/go-gitinfo.git",
"https_url": "https://github.com/afeiship/go-gitinfo.git",
"url": "https://github.com/afeiship/go-gitinfo"
}
}