V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
jxia
V2EX  ›  Go 编程语言

gitw - Git 命令包装器,生成 git 变更记录日志,获取 repo 信息和一些 git 命令工具

  •  1
     
  •   jxia · 2022-07-06 17:17:37 +08:00 · 789 次点击
    这是一个创建于 653 天前的主题,其中的信息可能已经有所发展或是发生改变。

    gitw - Git 命令包装器,生成 git 变更记录日志,获取 repo 信息和一些 git 命令工具。

    Github https://github.com/gookit/gitw

    • 包装本地 git 命令
    • 快速运行 git 命令
    • 快速查询存储库信息
      • 获取 remote, branch 详细信息
    • 通过 git log 快速生成版本变更日志
      • 允许自定义生成配置
      • 允许自定义生成过滤、样式等
      • 可以直接在 GitHub Actions 中使用

    生成变更日志

    可以通过 gitw/chlog 包快速生成变更日志。

    安装

    go install github.com/gookit/gitw/cmd/chlog@latest
    

    使用

    生成变更日志::

    chlog prev last
    chlog last head
    chlog -c .github/changelog.yml last head
    

    Outputs:

    chlog-demo

    仓库信息

    可以通过 gitw 在本地快速获取 git 存储库信息。

    repo := gitw.NewRepo("/path/to/my-repo")
    

    Branch 信息

    brInfo := repo.CurBranchInfo()
    
    dump.Println(brInfo)
    

    Output:

    one-remote-info

    更多

    更多使用说明请看 README 和 godoc

    Github https://github.com/gookit/gitw

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   996 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 22:47 · PVG 06:47 · LAX 15:47 · JFK 18:47
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.