its pretty simple to find all the commits containing a particular file.
git log -- .\Database\Tables\sometable.sql
but is there a simple way to find all the commits for a file type (recursively down child directories?) or will I need to write a script to do this?
(conceptually...)
git log -- .\Database\*.sql --recursive
Use git log --all <filename> to view the commits influencing <filename> in all branches.
In Git, we can use git show commit_id --name-only to list all the committed files that are going to push to the remote repository.
Find what file changed in a commit To find out which files changed in a given commit, use the git log --raw command. It's the fastest and simplest way to get insight into which files a commit affects.
It appears that perhaps you just need to escape the *
so that it doesn't get expanded by the command line. It would seem that you are on Windows so... but I am on Linux and tested like so:
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 on the last git log
is:
commit 8fdb718b5b616dd495c00eb7a6d123c33f7707e5
Author: <snipped>
Date: Sun Oct 14 19:49:43 2012 -0400
colors and dirs
On the Windows escaping of *
... perhaps put it in either single or double quotes? I'll add if I figure something out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With