#git #cli #git-profile #git-user

应用 gprofile

快速切换和管理多个 git 用户配置文件

2 个不稳定版本

0.2.0 2022年2月24日
0.1.0 2022年1月8日

#git 中排名 480

MIT/Apache

785KB
282

gprofile Crates.io 许可证

快速切换和管理多个 git 配置文件。

演示

A demonstration

动机

有许多类似的工具,它们提供了更多功能,外观也比这个更漂亮。它们之间的主要区别在于这个工具具有 零依赖,而我专注于减少编译时间和二进制文件大小。

--release 模式下构建的最终二进制文件大小仅为 456K(在我的机器上)。

安装

如果您已安装 rust 工具链,则只需执行以下操作:

cargo install gprofile

或者,您可以从 发布页面 下载预构建的二进制文件到您的 $PATH。

注意:生成的二进制文件名为 git-profile

用法

# list available profiles
git profile --list

# use `work` profile
git profile --use=work

# delete `work` profile
git profile --delete=work

# edit `personal` profile
git profile --edit=personal

帮助

USAGE:
  gprofile [FLAGS]
  gprofile [OPTIONS] <PROFILE>

FLAGS:
  -h, --help            Prints help information
  -v, --version         Prints version information

OPTIONS:
  -c, --create            Create a new profile
  -r, --remove=<PROFILE>  Delete a given profile
  -e, --edit=<PROFILE>    Edit a given profile
  -u, --use=<PROFILE>     Set the given profile as current user name and email
  -l, --list              List available profiles
  -d --dump-config        Dump config path & config to stdout

无运行时依赖