Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git log --stat summary of branch

I would like to show how many changes (insertions+deletions) I made on a feature branch. Is there a way to get a summary of the git log --stat output for the changes between 2 commits (branch root / tip).

Thanks.

like image 909
opatut Avatar asked Nov 01 '12 17:11

opatut


People also ask

What is git log -- stat?

git log --stat. The --stat flag causes git log to display. the files that were modified in each commit. the number of lines added or removed. a summary line with the total number of files and lines changed.

Does git log show all branches?

Graph all git branchesDevelopers can see all branches in the graph with the –all switch. Also, in most situations, the –decorate switch will provide all the supplemental information in a formatted and nicely color-coded way.

How do I see the commit history of a branch?

On GitHub.com, you can access your project history by selecting the commit button from the code tab on your project. Locally, you can use git log . The git log command enables you to display a list of all of the commits on your current branch. By default, the git log command presents a lot of information all at once.


1 Answers

for a feature branch you wand to use

git diff --stat dev..feature

this relies on not doing back merges. See my post here: http://dymitruk.com/blog/2012/02/05/branch-per-feature/

--stat can take parameters. This is useful if you have a wider terminal. You can do --stat=200 to say that your display can accommodate 200 columns.

If you want to use this in a script, use --numstat instead. It will not truncate paths.

like image 175
Adam Dymitruk Avatar answered Oct 06 '22 00:10

Adam Dymitruk