how to set default line endings in source tree

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

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.

OR

You can edit the config file of your 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.

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

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 May 30, 2018 in Sourcetree

Tip from the team: configuring Git or Mercurial in Sourcetree

Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...

548 views 1 2
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