#git-workflow #git #git-flow

app git-flow-rs

用 Rust 编写的可扩展 git flow

10 个不稳定版本 (3 个重大更改)

0.4.3 2024年5月3日
0.4.2 2024年5月2日
0.4.1 2024年3月16日
0.4.0 2024年2月7日
0.1.3 2023年11月15日

命令行实用工具 中排名第 1184

MIT 许可证

48KB
1.5K SLoC

git-flow.rs

用 Rust 编写的可扩展 git flow。

可扩展:自定义符合您偏好的工作流程。

遵循配置:标准化团队协议。

安装

cargo install git-flow-rs

或者下载发布的二进制文件。

用法

gitflow --help

确保已安装 git 命令。

Usage: git-flow [OPTIONS] <COMMAND>

Commands:
  start   start a task
  finish  finish a task
  drop    drop a task
  track   track a task
  sync    sync branches
  list    list avaliable branch types
  check   check config
  help    Print this message or the help of the given subcommand(s)

Options:
  -c, --config <FILE>
  -h, --help           Print help
  -V, --version        Print version

一个小例子。

# start a feature
git flow start something feature
# or git flow start feature/something
# then branch feature/something created from dev

# implement the feature
# commit changes

# finish the feature
git flow finish feature/something
# then feature/something merged into dev and this branch deleted

配置

全局配置文件应位于 ~/.config/git-flow/config.toml(在 windows 上为 C:\Users\您的用户名\AppData\Roaming\git-flow\config.toml)。

本地配置文件应位于 <GitRoot>/.git-flow.toml

没有默认配置。以下是一个示例。

可用策略: merge, rebase, cherry-pick

可用钩子: before_start, after_start, before_finish, after_finish, before_drop, after_drop

正则表达式在 to.n.name 中可用。

[[branch_types]]
name = "feature"
create = "feature/{NAME}"
from = "dev"
to = [{ name = "dev", strategy = "merge" }]
after_start = { command = "git", args = [
  "push",
  "origin",
  "feature/{NAME}:feature/{NAME}",
] }
after_finish = { command = "git", args = [
  "push",
  "origin",
  "--delete",
  "feature/{NAME}",
] }

[[branch_types]]
name = "hotfix"
create = "hotfix/{NAME}"
from = "main"
to = [
  { name = "main", strategy = "merge" },
  { name = "dev", strategy = "merge" },
  { name = "feature/*", strategy = "merge" },
]

[[branch_types]]
name = "bugfix"
create = "bugfix/{NAME}"
from = "dev"
to = [
  { name = "dev", strategy = "merge" },
  { name = "feature/*", strategy = "merge" },
]

[[branch_types]]
name = "release"
create = "release/{NAME}"
from = "dev"
to = [{ name = "main", strategy = "merge" }]

依赖项

~9–20MB
~281K SLoC