0

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?

Community
  • 1
  • 1
user3619165
  • 380
  • 1
  • 2
  • 13

1 Answers1

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