Even though I did not change anything, Git tells me that file has changed whenever I save a file.
I cloned a repo, opened a random file, and hit save. here is what git diff
shows me.
1. `{{pathFor contextObject queryKey=queryValue hash=anchorTag}}`
or
2. ```
- {{#with contextObject}}
+ {{#with contextObject}}
{{pathFor queryKey=queryValue hash=anchorTag}}
{{/with}}
```
But the line deleted and the line added are the same. This happens in multiple lines. Any ideas about why, and how to stop this?
Update
When I do git diff -R
, I see a trailing whitespace:
- {{#with contextObject}}
+ {{#with contextObject}}[trailing whitespace]
When I try to remove the whitespace manually, it is not there. Also, I have turned on Remove Trailing Whitespace
option in Atom.
Why is this happening?
It could be that your editor automatically removes whitespace, or that it changes the type of newline or tabs to spaces. What happens when you diff using the
diff
command?