Find all git commits file type

it is pretty easy to find all the commits containing a particular file.

git log -- .\Database\Tables\sometable.sql 

but is there an easy way to find all the commits for a file type (recursively down child directories?) or do I need to write a script for this?

(conceptually...)

 git log -- .\Database\*.sql --recursive 
+4
source share
2 answers

It looks like you just need to avoid * so that it does not expand on the command line. It would seem that you are on Windows like this ... but I'm on Linux and testing like this:

 git init mkdir -p blue/red/green touch blue/red/green/colors git add blue/red/green/colors git commit -m "colors and dirs" touch blackAndWhite git add blackAndWhite git commit -m 'b&w' git log -- \*ors 

The result of the last git log is:

 commit 8fdb718b5b616dd495c00eb7a6d123c33f7707e5 Author: <snipped> Date: Sun Oct 14 19:49:43 2012 -0400 colors and dirs 

In the case of Windows * escaping ... is it possible to put it in single or double quotes? I will add if I come up with something.

+6
source

I wanted to see all the contributions by type for all users in my repository. I found a Ruby package that will do this, git fame ( here ). If you type git fame . --by-type git fame . --by-type , it will output something like this:

enter image description here

0
source

Source: https://habr.com/ru/post/1439709/


All Articles