The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

how to set default line endings in source tree

Danielle Sherstobitoff
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 14, 2016

we've set the .attribute file in github.com but when we download .pas files to a local repository in source tree the LF isn't being turned into CRLF

 

Is there a setting to fix this?

 

I tried searching your KB but nothing so far.

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

4 votes
QwazyWabbit
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
July 14, 2016

This functionality doesn't exist in SourceTree but in GIT itself. You can configure GIT to do it by typing:

git config core.autocrlf true in a command line console in your repository directory. This sets it globally for all repos.

OR

You can edit the config file for each repository from SourceTree indirectly by opening Repository | Repository Settings | Advanced tab, then click on the Edit Config File button at the bottom.

You'll see something that looks like this:

[core]
 repositoryformatversion = 0
 filemode = false
 bare = false
 logallrefupdates = true
 symlinks = false
 ignorecase = true
 hideDotFiles = dotGitOnly
...

Add autocrlf = true anywhere in the core section of the config file.

Warning: Notepad doesn't handle the initial line endings of the config file, use Wordpad or any editor you prefer.

While you're in the repository settings dialog, review the .gitignore file and make sure *.pas isn't declared there.

TAGS
AUG Leaders

Atlassian Community Events