Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git: find largest commit(s)

Tags:

git

What would be a way to find largest commits (i.e. commits introducing most changes, for instance counted as the number of added/removed lines) in a git repo?

Note that I really want largest commits, not largest files, so git find fat commit is not helpful here.

like image 960
akoprowski Avatar asked Oct 08 '10 12:10

akoprowski


People also ask

How do I find large files in git?

Installing Git LFSInstall Sourcetree, a free Git GUI client that comes bundled with Git LFS. Once git-lfs is on your path, run git lfs install to initialize Git LFS (you can skip this step if you installed Sourcetree): $ git lfs install Git LFS initialized. You'll only need to run git lfs install once.

How do I see commit history?

`git log` command is used to view the commit history and display the necessary information of the git repository. This command displays the latest git commits information in chronological order, and the last commit will be displayed first.

Which command shows limit number of commits?

Which Command is used to show limited number of commits? git log -n Command is used to show limited number of commits.


1 Answers

you can use git log --format=format:"%H" --shortstat. It will output something like

b90c0895b90eb3a6d1528465f3b5d96a575dbda2
 2 files changed, 32 insertions(+), 7 deletions(-)

642b5e1910e1c2134c278b97752dd73b601e8ddb
 11 files changed, 835 insertions(+), 504 deletions(-)

// other commits skipped

Seems like an easily parsed text.

like image 181
max Avatar answered Oct 19 '22 12:10

max