It's basically a play on List all commits for a specific file question. I want to list all commits that don't include a specific file (or files). Is that possible to do?
Asked
Active
Viewed 24 times
1 Answers
0
If don't include means the file is not changed in the commit, Set A is git log --pretty=%h --follow <file>
, Set B is git log --%h
, and B - A = {sha1 values of commits that don't include the file}
.
git log --pretty=%h --follow *file* > a.txt
git log --pretty=%h *file* > b.txt
sort b.txt a.txt a.txt | uniq -u

ElpieKay
- 27,194
- 6
- 32
- 53
-
Well, I'd use `comm` rather than `sort`, but yes. :-) – torek Mar 02 '17 at 03:36