git 账户管理工具

查看 27|回复 1
作者:kinfuy   
theme: nico
起因
最近多个项目老是需要切换 git 账号,git 命令都输入烦了,就想能不能像 nvm ,或者 nrm 一样管理 git 账户,正好最近写了一个 node-cli 的模板,正好有用武之地,说干就干。
开始

用法
just like nvm
gacm ls
gacm use xxx ---local
gacm use xxx ---global
gacm add --name xxx --email xxx
gacm delate user
功能需求
  • 切换 git 账户(包含当前项目,全局用户,系统用户)
  • 增加用户
  • 删除用户
  • 查看用户列表

    获取 cli 模板
    拉取一下我的模板工具template-node-cli
  • 内置了基于 typescript+rollup+gulp 的打包工具
  • 给出了一些简单模板

    核心思路
  • 通过 cli 执行 shell 命令

    git config --xxx user.name xxxx
    git config --xxx user.email xxxx
    源码
  • github

  • passive   
    git 自带的
    [includeIf "gitdir:~/work/"]
    path = ~/work/.gitconfig
    [includeIf "gitdir:~/opensource/"]
    path = ~/opensource/.gitconfig
    不行吗
    您需要登录后才可以回帖 登录 | 立即注册

    返回顶部