查看“︁Git/日志”︁的源代码
来自康健生活
←
Git/日志
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
== log == 查看记录 {{shc|<syntaxhighlight lang="bash"> git log --oneline</syntaxhighlight>|$|/home/kangkk}} === 查找人 === 查找单人。 {{shc|<syntaxhighlight lang="bash"> git log --online --author="kangjian"</syntaxhighlight>|$|/home/kangkk}} 查找多人。 {{shc|<syntaxhighlight lang="bash"> git log --online --author="kangjian\|lanqian"</syntaxhighlight>|$|/home/kangkk}} === 查找关键字 === {{shc|<syntaxhighlight lang="bash"> git log --online --grep="kangkk"</syntaxhighlight>|$|/home/kangkk}} === 查找文件内容信息 === {{shc|<syntaxhighlight lang="bash"> git log -S "75cdn"</syntaxhighlight>|$|/home/kangkk}} === 查找时间区间 === 查找自2021年2月24日以后,早上10点到下午8点的记录。 {{shc|<syntaxhighlight lang="bash"> git log --online --since="10am" --until="8pm" --after="2021-02-24"</syntaxhighlight>|$|/home/kangkk}} === 查看文件 === {{shc|<syntaxhighlight lang="bash"> git log src/a.js</syntaxhighlight>|$|/home/kangkk}} 查看文件改动记录。 {{shc|<syntaxhighlight lang="bash"> git log -p src/a.js</syntaxhighlight>|$|/home/kangkk}} == reflog == {{shc|<syntaxhighlight lang="bash"> git reflog</syntaxhighlight>|$|/home/kangkk}} == 统计 == === 个人代码提交量 === {{Shc_out|<syntaxhighlight lang="bash"> git log --author="kangjian" --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 }' - </syntaxhighlight>|<syntaxhighlight lang="bash"> added lines: 170168, removed lines: 51562, total lines: 118606 </syntaxhighlight>|$|/home/kangkk}} 个人代码提交,附带时间区间。 {{Shc_out|<syntaxhighlight lang="bash"> git log --author=kangjian --since=2021-02-01 --until=2022-02-01 --format='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --author="$name" --pretty=tformat: --numstat | grep "\(.html\|.java\|.xml\|.properties\)$" | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }' -; done</syntaxhighlight>|<syntaxhighlight lang="bash"> kangjian added lines: 94, removed lines: 16, total lines: 78 </syntaxhighlight>|$|/home/kangkk}} === 增删代码量 === {{Shc_out|<syntaxhighlight lang="bash"> git log --format='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --author="$name" --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 }' -; done</syntaxhighlight>|<syntaxhighlight lang="bash"> cuili added lines: 19476, removed lines: 105928, total lines: -86452 heweixiao added lines: 3371, removed lines: 1532, total lines: 1839 kangjian added lines: 4571, removed lines: 1215950, total lines: -1211379 liuguanyu added lines: 1777938, removed lines: 106, total lines: 1777832 xuke5 added lines: 42708, removed lines: 590, total lines: 42118 </syntaxhighlight>|$|/home/kangkk}} === 总代码行数 === {{Shc_out|<syntaxhighlight lang="bash"> git log --format='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --author="$name" --pretty=tformat: --numstat | grep "\(.html\|.java\|.xml\|.properties\|.css\|.js\|.txt\)$" | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }' -; done</syntaxhighlight>|<syntaxhighlight lang="bash"> chenyiwen added lines: 32, removed lines: 19, total lines: 13 kangjian added lines: 9978, removed lines: 7263, total lines: 2715 kangkk added lines: 44189, removed lines: 37408, total lines: 6781 lizheming added lines: 14833, removed lines: 5913, total lines: 8920 shuliqi added lines: , removed lines: , total lines: wwenj added lines: 400, removed lines: 167, total lines: 233 yangyalin added lines: 286, removed lines: 138, total lines: 148 yangyalin1 added lines: 286, removed lines: 138, total lines: 148 yuyang7 added lines: 3926, removed lines: 1299, total lines: 2627 zhaowenbo added lines: 2396, removed lines: 432, total lines: 1964 康健 added lines: 8661, removed lines: 6907, total lines: 1754 </syntaxhighlight>|$|/home/kangkk}} === 贡献值统计 === {{Shc_out|<syntaxhighlight lang="bash"> git log --pretty='%aN' | sort -u | wc -l</syntaxhighlight>|<syntaxhighlight lang="bash"> 5 </syntaxhighlight>|$|/home/kangkk}} === 提交数统计 === {{Shc_out|<syntaxhighlight lang="bash"> git log --oneline | wc -l</syntaxhighlight>|<syntaxhighlight lang="bash"> 411 </syntaxhighlight>|$|/home/kangkk}} === 统计或修改的行数 === {{Shc_out|<syntaxhighlight lang="bash"> git log --stat|perl -ne 'END { print $c } $c += $1 if /(\d+) insertions/' </syntaxhighlight>|<syntaxhighlight lang="bash"> 1848029 </syntaxhighlight>|$|/home/kangkk}} == 提交次数排名 == {{Shc_out|<syntaxhighlight lang="bash"> git log --pretty='%aN' | sort | uniq -c | sort -k1 -n -r | head -n 5</syntaxhighlight>|<syntaxhighlight lang="bash"> 160 kangjian 93 cuili 61 liuguanyu 56 heweixiao 41 xuke5 </syntaxhighlight>|$|/home/kangkk}} === 统计或修改的行数 === {{Shc_out|<syntaxhighlight lang="bash"> git log --stat|perl -ne 'END { print $c } $c += $1 if /(\d+) insertions/'</syntaxhighlight>|<syntaxhighlight lang="bash"> 257528 </syntaxhighlight>|$|/home/kangkk}}
此页面嵌入的页面:
模板:Shc
(
查看源代码
)
模板:Shc/style.css
(
查看源代码
)
模板:Shc out
(
查看源代码
)
模板:Shc out/style.css
(
查看源代码
)
返回
Git/日志
。
导航菜单
康健生活
搜索
user-page
通知
user-interface-preferences
个人工具
登录
五一
多读书,多运动,多到远处走走,再看看不一样的世界。