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

This widget could not be displayed.

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.

This widget could not be displayed.

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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted an hour ago in Statuspage

What are your best incident management tips and stories? #HugOps

 👋Community members! Downtime happens. And great incident response takes a village. Teams like Support, Dev, SRE, Ops, IT, and Marketing have to come together to resolve the problem while keep...

13 views 0 2
Join discussion

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