0.0.3 • Published 2 years ago

@croatialu/gi v0.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

gi

根据目录中的 .gitidentity.json 修改git仓库的 user/email 信息

安装

npm i @croatialu/gi -g

使用

  1. 在父目录创建 .gitidentity.json 文件
  2. 填入内容
{
  "name": "croatialu", // git 名
  "email": "wuli.croatia@foxmail.com", // git 显示邮箱
  "level": 3, // 递归深度
  "excludeDir": [] // 排除的文件夹名
}
  1. 在目录中执行 gi
  • 如果该目录是一个仓库, 则会将 .gitidentity.json 配置同步到本仓库
  • 如果该目录不是一个仓库,则会往下递归查找目录, 最大层级为 level,排除 excludeDir 后, 将满足规则的git仓库进行配置同步

举例

├── remote
│   ├── gi
│   ├── taro-lazy-swiper
│   └── taro-playground
└── workspace
    ├── company-project-a
    └── company-project-b

有个人仓库目录 remote 和 公司项目仓库 workspace, 而当想针对 remote 个人仓库单独配置 user.nameuser.email, 则只需要创建 .gitidentity.jsonremote/.gitidentity.json 中, 然后运行 gi ,就会自动同步git配置信息

同理,公司仓库也一样, 配置 .gitidentity.jsonworkspace/.gitidentity.json中,balabala....

最终的目录结构是:

├── remote
│   ├── gi
│   ├── taro-lazy-swiper
│   └── taro-playground
|   └── .gitidentity.json
└── workspace
    ├── company-project-a
    ├── company-project-b
    └── .gitidentity.json
0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

0.0.0

2 years ago