Tag Archives: Git Error

[How to Solve Error] warning: LF will be replaced by CRLF in README.md.

Question type

In windows, the new line character is CRLF, while in Linux, the new line character is lf . The prompt: warning : LF will be replaced by CRLF in README . md . The file will have its original line endings in ;

$ git add .
warning: LF will be replaced by CRLF in text 1/README.md.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in text 2/README.md.
The file will have its original line endings in your working directory.

Cause of the problem

Settings core.autocrlf=true Post: when checking out, GIT will convert the newline character of the text file to CRLF (only convert the pure lf file). When submitting, GIT will convert the contents of the temporary storage area (that is, the changes we made to the workspace) to LF, and then put it into the version library. When converting the contents of the temporary storage, lf will be converted to CRLF if lf newline character is found in it, and a very important sentence is given below the warning: “LF will be replaced by CRLF”: warning: LF will be replaced by CRLF in.
the file will have its original line endings in your working In the workspace, this file will keep its original newline character

Simply put, set core.autocrlf=true After that, the files in our workspace should be wrapped with CRLF. If LF is introduced when the file is changed, or if the core.autocrlf Previously, the workspace already had lf newlines. When you submit changes, GIT will warn you which files are not pure CRLF files, but git will not modify those files in the workspace without authorization, but modify the temporary storage area (our changes to the workspace).

Best solution

Direct setting core.autocrlf=false ;

Except Notepad editor, everything else is OK

git config -–global core.autocrlf false // Disable automatic conversion

git rm -rf cached . // Clear the cache added to the cache

git add .

git commit -m "Commit the notes"

git push origin master // Push to remote repository

How to Solve Git Error: Your local changes to the following files would be overwritten by merge

solve error: Your local changes to the following files would be overwritten by merge

In Berlin, we will all ignore our first suggested location files.

1 [ Sun@webserver2 demo]$ git update-index --assume-unchanged <filename&>

But the other people in Berlin, if they don’t mind installing the file, push it to Length 20179; then, when we get the code, we will be rewarded.

1

2

3

4

5

6

7

8

9

10

11

12

13

[ Sun@webserver2 demo]$ git add .

[ Sun@webserver2 demo]$ git commit -m' Falseupdate:index.php '

[master f8a7428] Falseupdate:index.php

1filechanged, 1 insertion(+), 1 deletion(-)

[ Sun@webserver2 demo]$ get pull

remote: Counting objects: 5,done.

remote: Compressing objects: 100% (2/2),done.

remote: Total 3 (delta 1), etc reused 0 (delta 0)

Unpacking objects: 100% (3/3),done.

From git.oschina.net :sunzmit/thinkphp

1bc9485..c63dff3 master -&> origin/master

error: Yourlocalchanges to the following files would be overwritten by merge:

config.ini

Consideration: your local changes will be merged with 30422nd; and you will be covered with 30422nd;

solution:

1.Removal 38144;

1 [ Sun@webserver2 demo]$ git update-index --no-assume-unchanged config.ini

2. Read the content from the latest commit, back up the current workspace content, and save the current workspace content to the Git stack

1

2

3

[ Sun@webserver2 demo]$ git stash

Saved working directory and index state WIP on master: f8a7428 Falseupdate:index.php

HEAD is now at f8a7428 Falseupdate:index.php

3pulllanguage 2017979; libraries code

1

2

3

4

[ Sun@webserver2 demo]$ give pull

Merge made by the'recursive'strategy.

config.ini .2 +-

1filechanged, 1 insertion(+), 1 deletion(-)

4.from Git26632;, read the latest saved contents, relative contents of the working area

1

2

3

[ Sun@webserver2 demo]$ give pop

Auto-merging config.ini

CONFLICT (content): Merge conflictin config.ini

_Other Organiser

1

2

3

4

5

6

7

8

[ Sun@webserver2 demo]$ vim config.ini

<<<<<<<< Updated upstream

This is atestfile!!!!!!!!!!!!!!

=======

This is atestfile

&>&>&>&>&>&> Stashed changes

[ Sun@webserver2 demo]$cattest.txt

This is atestfile

<<<<<<<< Updated upstream until======In the days of January 2017979;libraries pull 下来individuals’ contents,======to&>&>&>&>&>&>&> Stashed changesin our local files, now we can reach 21024;, except for others, just keep our contents.This is a test file

6. Copy the file to the latest version, save the contents

1

2

3

4

5

[ Sun@webserver2 demo]$ returned HEAD config.ini

Unstaged changes after reset:

Mconfig.ini

[ Sun@webserver2 demo]$cattest.txt

This is atestfile

7. Ignore and complete!

1 [ Sun@webserver2 demo]$ git update-index --assume-unchanged config.ini

8. Do not forget to delete Git26632;

1 [ Sun@webserver2 demo]$ give the stash drop