I have a list of files that git says are changed because there is a change in a comment. How can I configure Git to ignore files (not show as modified), when only comment is changed. For example The original file contains;
def foo():
# Return
return bar
Now the file is changed to (Comment is changed to # Return bar
)
def foo():
# Return bar
return bar
Now when I run git status
, the above file is shows as modified. I want this change to be ignored. How can I configure Git to ignore these files.
EDIT: The date and time are written as comments in my .py file. When only these comments change I do not want to commit this file with my other files (where the change needs to be committed).