Whitespace Problems in a Windows / FTP / Mac Environment


We are configuring SourceTree for our dev environment. I am on a Mac and my partner on a Windows 7 PC. We have a master repo set up on a NAS and clone locally to our own machines. We typically work on a site via FTP on an external server, then copy our modified files over to our local clone directory, review, commit, and push up to the master repo.

We are having an apparent issue with Line Endings between Windows and Mac. When I download a file from the FTP server to my local clone, SourceTree identifies every file as being modified. I know that you can toggle 'Ignore Whitespace', which works to ignore these non-changes, but in the list of Pending files, every file still appears to be modified, and shows up in the Commit list as well.

There are several SO answers regarding .gitattributes which we've tried, with no luck.

Do you have any tips for fixing this issue?

Thank you!

2 answers

1 accepted

If the shared server is Linux-based and you have SSH access, I'd recommend running dos2unix (for the mac) or unix2dos (for windows) on the entire batch prior to downloading. You may consider looking for FTP clients or local utilities that make these conversions for you instead.

Thanks Seth. The answer was to install homebrew and then use the terminal, filtering by filetype to convert some dos files to linux and vice versa:

find . -name "*.css" -type f -exec unix2dos {} \;

find . -name "*.php" -type f -exec unix2dos {} \;

find . -name "*.js" -type f -exec dos2unix {} \;

find . -name "*.svg" -type f -exec dos2unix {} \;

Suggest an answer

Log in or Join to answer
Community showcase
Jason Wong
Published Tuesday in Agility Beta

Welcome to agility

Every team in the world is unique, and so   Atlassian believes   that each and every team's best way of working  needs to  be molded to their unique circumstances  – ...

397 views 6 16
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot