sourcetree shows unstaged files of files I did not change ?
Asked by Wolfgang Blaszczyk:

When I changed some files and try to push them to the origin, and after pulling again from origin, I see in my File status Unstaged files of files I did not change. Why is that and why can I Push without having staged or even commit files locally?


Answers:
author: Seth
body: Usually when files have mysterious changes, they end up being related to line-endings or file permissions. It's not unheard of for something on your computer to automatically change one of those things. Most diff tools will let you view whitespace differences, which should tell you if it's a line-ending problem (all lines will be "modified").

To answer the second part of your question, you technically CAN push, but if you haven't committed, nothing will happen. Git will report the push operation as successful, but nothing will have changed in either your local or remote repositories.

Checking file permissions will depend on your OS.

comments: author: Malcolm Briggs
body: Other user changes appear in your local, that is what he means. Yes, we have the same issue and I think this is something to do with the config settings and how SourceTree and Bitbucket handles the settings. However, I don't know how it should be setup in order to not cause any problem. This must be addressed or resolved by Atlassian I believe.


author: thinsoldier
body: If the preview of the changes in Sourcetree shows all the original lines of ![minus](/html/@E63A1362032AF9D4C4C2BC978871E2BC/images/emoticons/minus.png "minus") text followed by all the original lines of ![plus](/html/@FFB122F77CA920A8EA19F633E8E71F4E/images/emoticons/plus.png "plus") text again, then the thing that changed is line endings.

If the preview shows the file but no actual indication of lines that have changed PastedGraphic-3.png

then the execute permission of the file has changed.

The execute permission is the only *attribute* of a file that git tries to track. SourceTree does not know how to show that the permission has changed. It just shows the file in the list of modified files with no preview or a broken preview.

<br />

To make git not track the attribute changes (and thereby avoid the problem in SourceTree) run this command via terminal from within a git project folder:

git config core.filemode false

<br />

**Other things that might look broken:**

PastedGraphic-1.png

If the changes shown in SourceTree look like this it's because the file was saved with Classic Mac line endings and SourceTree doesn't know how to show them properly. But pressing CMD+D on the file will open it in BBedit's side by side comparison view.

<br />

PastedGraphic-2.png

If the changes shown look like *every single line* of the file has changed even though nothing has changed, that is because the line endings were changed somehow.

For example, if I download a jquery plugin from the web and it was created with windows line endings originally and I upload that, it seems that sometimes my ftp client or my webserver or *something* will change the line endings in that file from windows to unix. If I download that file from web server and overwrite the local original, SourceTree will show the line ending changes like this.

<br />

<br />

<br />

[](https://community.atlassian.com/t5/Sourcetree-questions/sourcetree-shows-unstaged-files-of-files-I-did-not-change/qaq-p/329327?attachment-id=3930){#link_1168b133831b9e}  
[](/tnckb94959/attachments/tnckb94959/sourcetree-questions/9906/1/PastedGraphic-2.png){#display_1168b133831b9e_0}  
[](https://community.atlassian.com/t5/Sourcetree-questions/sourcetree-shows-unstaged-files-of-files-I-did-not-change/qaq-p/329327?attachment-id=3931){#link_1168b133831b9e_0}  
[](/tnckb94959/attachments/tnckb94959/sourcetree-questions/9906/2/PastedGraphic-3.png){#display_1168b133831b9e_2}  
[](https://community.atlassian.com/t5/Sourcetree-questions/sourcetree-shows-unstaged-files-of-files-I-did-not-change/qaq-p/329327?attachment-id=3932){#link_1168b133831b9e_1}  
[](/tnckb94959/attachments/tnckb94959/sourcetree-questions/9906/3/PastedGraphic-1.png){#display_1168b133831b9e_4}