我怎样才能获得今天在git中完成的总线? [英] How can I get the total lines committed today in git?

查看:204
本文介绍了我怎样才能获得今天在git中完成的总线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现一直存在回购协议的git的一般统计数据,但我有兴趣做类似的事情:

 今天的git 

获得诸如提交数,线条数等等。



我最感兴趣的是当前用户的#行。我可以将其他东西的结果合并到我自己的

gitstats 工具: http://gitstats.sourceforge.net/



所有以下命令假定使用例如bash。通过运行以下命令,您可以获得与今天具有相同日期的第一次提交。

 > first_commit =`git log --pretty = format:%h--since$(date +%y-%m%-d):00:00

下面的命令将处理git仓库以进行统计:

 > gitstats -c commit_begin =< COMMIT_ID> 。 target / gitstats 

通过结合这些我们可以得到一个简单的命令,我们可以将其设置为别名,if我们希望:

 > first_commit =`git log --pretty = format:%h--since$(date +%Y-%m%-d):00:00| tail -n1`; gitstats -c commit_begin = $ first_commit。 target / gitstats 

然后打开 ./target/gitstats/index.html 与您的首选浏览器


I found general statistics on git for all the time the repo has existed but I'm interested in doing something like:

git today 

And get things like # of commits, # of lines , etc. broken down by author.

I am mostly interested in # of lines by current user.. I can combine the results of other things on my own

解决方案

If you want to see a graphical representation of a git repository's activity, use the gitstats utility: http://gitstats.sourceforge.net/

All the following commands assume use of, e.g., bash. By running the following command you can get the first commit that has the same date as today.

> first_commit=`git log --pretty=format:"%h" --since "$(date +%Y-%m%-d):00:00"

And the following command will process the git repository for statistics:

> gitstats -c commit_begin=<COMMIT_ID> . target/gitstats

And by combining these we can get a simple command we can set as an alias, if we wish:

> first_commit=`git log --pretty=format:"%h" --since "$(date +%Y-%m%-d):00:00" | tail -n1`; gitstats -c commit_begin=$first_commit . target/gitstats

Then open ./target/gitstats/index.html with your preferred browser

这篇关于我怎样才能获得今天在git中完成的总线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆