0

I am looking for a way to force smudge filter to run by simulating a real life checkout. Let's say I just created a new branch and did not modify any files but want to test my new smudge filter. According to some answers such as git smudge/clean filter between branches and git: re-checkout files after creating smudge filter it should be possible by running:

git checkout HEAD --

but in doesn't work with git 2.9.0. Method suggested in accepted answer here How do I force git to checkout the master branch and remove carriage returns after I've normalized files using the "text" attribute? works but I don't like because it seems fragile. Is there a safe way to do what I want to do in Git still today?

user1042840
  • 1,925
  • 2
  • 16
  • 32
  • As VonC noted in the first edit to that answer ("edited Feb 9 '14 at 1:47"), you need to run not `git checkout HEAD --` but rather `git checkout HEAD -- `. The to use can simply be `.` if you are in the top level of the work-tree. – torek Sep 03 '16 at 22:47
  • @torek: I also tried it and it doesn't work with `git 2.9.0`. – user1042840 Sep 04 '16 at 11:14

1 Answers1

0

If you want to check something out, first you will need to check something in. Just create a trash branch, add a test file with whatever is needed for the smudge test, commit it and test away. When complete delete the branch.

Philip Oakley
  • 13,333
  • 9
  • 48
  • 71