1.首先找到代码库位置
需要在gitlab安装的机器上进行,下面是gitlab安装后代码默认存储位置
cd /var/opt/gitlab/git-data/repositories/
2.代码统计指令
git log --since="2021-10-01" --before="2021-12-17" --author="author" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 -$2} END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add ,subs, loc}'
3.效果如下