So I'm using source tree and I'm working on a website, however 1 of my JS files ALWAYS treats the whole file as a single hunk. Hunk 1: Lines 0-0 It shows the first line as removed, then the whole file in white then the first line in green and the whole file in white. So its impossible to review what changes I made, discard or change individual hunks/lines. No other file is doing this and its only this file. It also appears this way in bitbucket so without doing a side-by-side diff I can't see what changes were done. Why is this happening? What steps should I take to resolve this?
I had the same problem, Hunk 1: lines 0-0 and it would not show updates in the file. I was able to solve the problem by copying the code, deleting the (php) file in question, creating it again fresh, and pasting the code back in. YMMV.
I would suspect white-space changes, possibly line-endings. Is SourceTree configured to show whitespace changes in the diff panel?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, if I add a few empty lines to a normal files it'll show as new empty lines in source tree.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
By "line-endings", I don't mean extra newlines, I mean the different byte sequences that can be used to signify a new line based on the source OS. http://en.wikipedia.org/wiki/Newline
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you switch sourcetree to ignore whitespace, you should be able to get a useable diff.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So I actually checked the settings and it's already set to ignore white space, I was testing with new lines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
FYI SourceTree's diff panel doesn't seem to have a clue about displaying files that use Classic Mac line endings.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
FYI if you set a file to be executable it will show as changed but without showing any lines have actually changed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If its the line endings why is only one file effected? How do I change this file to a crlf endings? If its executable how to a revert that?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.