https://github.com/mwumli/set-git-author
set a suitable git author by some rules, such as remote repo
https://github.com/mwumli/set-git-author
Last synced: 3 months ago
JSON representation
set a suitable git author by some rules, such as remote repo
- Host: GitHub
- URL: https://github.com/mwumli/set-git-author
- Owner: MwumLi
- License: mit
- Created: 2021-10-09T05:00:59.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-10-09T05:47:31.000Z (over 3 years ago)
- Last Synced: 2024-11-24T20:32:39.818Z (6 months ago)
- Language: JavaScript
- Size: 15.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# set-git-author
set a suitable git author by some rules, such as remote repo.
## Usage
> Notice: you can use install it globally by npm/yarn, or use it directly by `npx set-git-author`
1. set remote repo rules `$HOME/.set-git-author.json`:
```json
{
"author": {
"git-(biz|open).xxx.cn": "LiLuo ",
"(github|gitlab).com": "MwumLi "
}
}
```
**Conf Explain**
> * if git remote repo is git-biz.xxx.cn/git-open.xxx.cn, use `LiLuo `
> * if git remote repo is github.com/gitlab.com, use `MwumLi `
> * else (no match or default), use your git config in your computer.2. set alias fot `git` commnad in `$HOME/.bashrc`:
```bash
alias git=`set-git-author && git`
```
`alias` can be placed in `~/.bashrc` or `~/.zshrc`, depending on your terminal environment.3. just run `git` is okay ! (no need to worry about the committer's mistakes😜)