How to get rid of false changes in git?

I am a happy user of PortableGit 1.7.0.2. Today I wanted to pull the project changes from the GitHub.com repository, so I did git pull. Failed to execute the following message: error: Your local changes to 'main.rb' would be overwritten by merge. Aborting.. I did not like the local changes, so I typed git reset --hard HEAD( git clean here , did not help any), but it did not work. When asked git status, I could still see the file as modified. git diffshowed me that each line of the file was changed, but git diff -bdid not detect any differences at all, so I assume that this is a problem with line endings. Which is strange, because the code is forced out only from Windows computers.

In any case, the question arises: how can I ignore local, dummy changes and merge with the latest changes from a remote repository?

+3
source share
1 answer

Did you try first git clean -f(pay attention to ` -f`)?
From the git configman page:

clean.requireForce

Boolean expression git-cleandoes nothing, unless stated -for -n. The default value is true .

-, autocrlf false ?
( Windows- Windows, Unix-eol Windows eol)

, , .

+2

Source: https://habr.com/ru/post/1749624/


All Articles