Disabling eol in bitbucket

Asked

Viewed 64 times

1

As version control tools I use Bitbucket and Sourcetree. It just seems like they get lost in the eol, saying that the same files are different. It seems to me that the solution is to disable eol in . gitattribute

But I’m not getting it...

Somebody’s got some help?

hugs

1 answer

3

Usually this happens due to differences as some platforms or text-editing programs work the line cyclists. Linux uses n (LF = 1 byte) while Windows by default uses r n (CRLF = 2 bytes). You should standardize the termination in your code editor or IDE (if it’s a source file) or configure git to automatically detect whether or not to treat line breaks. E.g. how to add settings in git local: git config --global core.autocrlf true

If you prefer directly in the file .gitattributes :

# Declara arquivos que sempre terão terminadores de linha CRLF no checkout.
*.sln text eol=crlf
# Declara arquivos que sempre terão terminadores de linha LF no checkout.
*.code text eol=lf

See other details here https://help.github.com/articles/dealing-with-line-endings/

About doing this ignore in bitbucket, it seems that there is no way anyway, as there is no option to add this directive.

  • Would it only work if it was on github? Pq with sourcetree in bitbucket whenever I copy equal files over the repository originals it says they are different.

  • @Gustavoemmel sourcetree is just an interface to Git or Mercurial. I think you add the directive to the file .gitattributes it will handle the expected line terminations. The file in question should be at the root of the local repository. One thing that may happen is that the first time you change the way you treat EOL you have to commit standardization to synchronize the environments.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.