Socket
Book a DemoInstallSign in
Socket

@croatialu/gi

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@croatialu/gi

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

Source
npmnpm
Version
0.0.1
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

gi

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

安装


npm i @croatialu/gi -g

使用

  • 在父目录创建 .gitidentity.json 文件
  • 填入内容
{
  "name": "croatialu", // git 名
  "email": "wuli.croatia@foxmail.com", // git 显示邮箱
  "level": 3, // 递归深度
  "excludeDir": [] // 排除的文件夹名
}

  • 在目录中执行 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

FAQs

Package last updated on 30 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts