Whitespace Problems in a Windows / FTP / Mac Environment

Hi,

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 Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Marketplace Apps

Tips on how to choose the best estimation method for your planning

Planning and grooming sessions all come with their own sets of rules. Team members meet to estimate stories or other work items, all according to an agreed-upon process. And with every session comes ...

86 views 0 11
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