当前位置: 动力学知识库 > 问答 > 编程问答 >

diff - Why Git adds - and + to all of my code?

问题描述:

Sometimes for example I change a word in line 100 and delete last 4 lines.

When I run "git diff" It shows a log which has a -(minus) and +(plus) before all lines whereas I changed only mentioned lines.

I thought it may be due to changing number of all lines but when I saw the changes again I didn't see any change to line numbers.

so what cause this?

网友答案:

That's just formatting to show what lines have been changed (added/removed/etc). Those +s and -s are not actually in your files.

网友答案:

Which text editor are you using? Perhaps it changed line endings between Unix/DOS. (i.e. LF to CR+LF)

分享给朋友:
您可能感兴趣的文章:
随机阅读: