https://github.com/mesuutt/git-mirror
Keep your git commit statistics
https://github.com/mesuutt/git-mirror
git github
Last synced: 3 months ago
JSON representation
Keep your git commit statistics
- Host: GitHub
- URL: https://github.com/mesuutt/git-mirror
- Owner: mesuutt
- Created: 2022-12-22T21:55:47.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-09T11:01:59.000Z (over 2 years ago)
- Last Synced: 2024-06-21T12:16:18.419Z (almost 2 years ago)
- Topics: git, github
- Language: Go
- Homepage:
- Size: 91.8 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Keep your git statistics with post-commit hook.
---
#### Usage
```shell
USAGE:
git-mirror [global options] command [command options] [arguments...]
COMMANDS:
install install post-commit hook for adding stats automatically
add add stats of latest commit
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--repo value git repo directory path of the mirror repo (default: "$HOME/.git-mirror")
--whitelist value comma seperated file extensions to create stats. eg: go,rs,sh,Makefile (default: all extensions)
--help, -h show help (default: false)
```
#### Install
- Grab a [binary](https://github.com/mesuutt/git-mirror/releases) or install via `go install github.com/mesuutt/git-mirror@latest`
- Create a git repository at `~/.git-mirror`(Do not forget `git init`)
- Copy [example config file](https://github.com/mesuutt/git-mirror/blob/main/example.config.toml) to your `~/.git-mirror` repo as `config.toml`.
#### Usage
git-mirror works as git post-commit hook.
So after install it you need to add related hook to project repositories by `git-mirror install` in your repos.
When you add a new commit to your project, stats of the commit will be added to the mirror repository.
----
#### Example generated stats repo content
```shell
$ tree
.
└── 2023
└── 01
├── 01
│ └── log.go
└── 02
├── log.go
├── log.java
├── log.md
├── log.sql
└── log.yaml
# Example generated file content after some commits
$ cat 2023/01/02/log.go
fmt.Println("02:42 24 insertion(s), 7 deletion(s)")
fmt.Println("03:39 83 insertion(s), 11 deletion(s)")
```
#### TODO
- [x] file type overwriting (`jsx=js`)
- [x] content template with config
- [ ] filename template with config
- [ ] excluding file extensions
- [ ] separating stat dirs like `personal/`, `work/`
- [ ] custom vars in params and templates(`-vars="project=foo-api-gateway"`)
----
License: MIT