A
A
askogorev2014-02-25 10:59:45
git
askogorev, 2014-02-25 10:59:45

Why is Git checkout not working?

git status
Result:

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   Main.cpp

I do git checkout -- Main.cpp, then git status
Result:
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   Main.cpp

Nothing happens. If you look at diff, then the changes in this file concern only the replacement of CRLF with LF.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
OnYourLips, 2014-02-25
@OnYourLips

If you look at diff, then the changes in this file concern only the replacement of CRLF with LF.
autocrlf should always be set to false.

S
Sergey, 2014-02-25
Protko @Fesor

I suspect you're using msysgit, which, if you've set it up in the configuration, doesn't see the difference between CRLF and LF, as it will automatically replace CRLF with LF when you commit.
What happens if you do git reset HEAD --hard? Or do you have more than one file changed?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question