0

I'm working with a BitBucket repository using SourceTree. The issue is that there's a file that apparently has changes. But it hasn't. I try to ignore the changes via Right click, Discard but it only changes the file name from File.php to file.php and viceversa (after ignore changes again). In my server that file is different from both in my local environment.

I just want to "clean" my SourceTree from annoying files, without affect my remote file.

I know the Git basics, but I'm not a real expert on it, so, I don't want to run the first command I find.

Screenshot

JDB
  • 25,172
  • 5
  • 72
  • 123
Daniel LG
  • 1
  • 1
  • You've changed a file that is tracked in the repository, so there are no real way to "ignore" that you've made changes. In fact, the whole point is to track changes to files you told the system to keep track of. – crashmstr Oct 10 '17 at 18:36
  • @crashmstr That's the point! I didn't make changes to the file. If you check in the first changes SourceTree detects, is ` – Daniel LG Oct 10 '17 at 18:49
  • Your screenshot shows other, significant changes to code. Also, you could be having an issue with an editor changing line endings or something like that. `git clean -dxf` or try re-cloaning. – crashmstr Oct 10 '17 at 18:51
  • @crashmstr You're right, there are other significant changes **that I didn't make**. And thanks, let me checkout that command :) – Daniel LG Oct 10 '17 at 18:56
  • 4
    If you're working with case-sensitive file system people (e.g., Linux systems) they can create two *different* files named `A` and `a`, or `File.php` and `file.php`. If you are on a case-*in*sensitive system (Windows) your system cannot store both files at the same time. Your Git then complains that you keep changing the contents of one of the two files. Since your system is the one with the limitation, you must convince the other users not to produce setups that cannot work on your system. – torek Oct 10 '17 at 19:05
  • Thanks @torek I'm using Windows, so, now can I do? – Daniel LG Oct 10 '17 at 19:21
  • @crashmstr I ran your command, and it didn't solve the problem. It deleted files but nothing happened to the main one. – Daniel LG Oct 10 '17 at 19:23
  • Try deleting and re-cloning the repository (although `git clean -dxf` should do about the same thing). If torek is right, then somewhere along the way, the filename changed and is not being picked up correctly. – crashmstr Oct 10 '17 at 19:48
  • @DanielLG: if this *is* the problem (I can't tell, but you can) you might consider the answers in https://stackoverflow.com/q/18000138/1256452 – torek Oct 10 '17 at 20:40

1 Answers1

0

@torek thank you so much. That link opened my eyes. A partner created 2 files file.php and File.php with linux, so he didn't have trouble pushing them to the repository. Now, when I pulled those changes I couldn't have both files. And because they were different from each other SourceTree always told me that there were changes. I hope this can help other people too. Thank you once again.

Daniel LG
  • 1
  • 1