在 npm 安装 时 自动初始化 git-flow

2020-02-18 10:03:51 +08:00
 Septembers

本工具功能很简单

即在 npm install 时通过 npm postinstall 这个 hook

完成自动配置 git config 完成 git-flow 的初始化

在团队协作时,可以避免 git-flow 的初始化配置不一致导致的各种问题

https://github.com/NiceLabs/git-flow-init


另一款工具是无外部依赖且实现干净的 git 信息获取

例如 commit hash, commit date, latest message 等信息

import git from "@nice-labs/git-rev";
// short commit-hash
console.log(git.commitHash(true)); // 75bf4ee
// long commit-hash
console.log(git.commitHash()); // 75bf4eea9aa1a7fd6505d0d0aa43105feafa92ef
// branch name
console.log(git.branchName()); // master

https://github.com/NiceLabs/git-rev

1672 次点击
所在节点    分享创造
1 条回复
isukkaw
2020-02-18 16:16:43 +08:00
好耶!

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/645442

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX