Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bitbucket carriage return

Tags:

git

bitbucket

When I push my source back to Bitbucket, I find BB cannot find the places I modified. I just input several carriage return problem in somewhere of the code but BB treat it as a big change of whole file and mark the whole file red or green. Any solution to this?

like image 376
user2312240 Avatar asked Oct 21 '22 11:10

user2312240


1 Answers

This sounds like a line-ending issue.

Windows and UNIX system don't use same line-ending, to prevent conflict from happening based on these, you should setup you git config this way: + on Windows : git config --global core.autocrlf true + on Unix : git config --global core.autocrlf input

The idea is to always push LF (Unix style). This way, Bitbucket or Git won't mark all line ending as changed resulting in huge diff file.

A side note, on Github, you can add ?w=0 to the end of URL to see the diff by ignoring whitespace. I don't know any similar feature on bitbucket unfortunatly :(

like image 141
Simon Boudrias Avatar answered Oct 30 '22 00:10

Simon Boudrias