0

how to ignore some changes in a file but not all the file

example: I want git to ignore the changes in a file if the only changes are like

Generation Time: 2022-02-21 16:42:18

if it's the only difference, I want git to skip it as changed

bouqbouq
  • 973
  • 2
  • 14
  • 34
  • You can use `git add --patch` and choose the changes that you want to commit. – D Malan Feb 22 '22 at 08:34
  • @DMalan I tried to apply it to all files but not working. tried to use regex `git add --patch "Generation Time: 20*" .` any idea – bouqbouq Feb 22 '22 at 08:56
  • 3
    Try git smudge/clean filters. https://stackoverflow.com/a/18881044/6330106 – ElpieKay Feb 22 '22 at 09:36
  • Just run `git add --patch` by itself (without the extra bit you added). Git will then ask you whether you want to add a specific change or not and you can type in `y` to add it or `n` to skip it. – D Malan Feb 22 '22 at 10:42

0 Answers0