After git clone was made, all files after opening the project in the intellije idea were displayed as unresolved (red color). Added a config file with config, a line with worktree=/*path to project , switched to another branch. All files changed visibility from unresolved to new (blue).

Update projecta writes all the files are updated, I tried to revert the file and it changed the visibility range from new to the usual file type (white color).

I think using revert for all files is not a good solution. What to do so that all files are under the normal visibility of the game, not (new, changed, unresolved)?

  • one
    Well, this is probably the Idea problem. What does git status say? - ixSci
  • that all files are 'modified' - JAVAvladuxa
  • Those. You have not changed anything in the files, but they are marked as changed and you want to ensure that all files are not changed, I understand correctly? - ixSci
  • Can @ixSci do this because of line endings? Author, but what does git diff show? - Nick Volynkin ♦

2 answers 2

It’s not at all clear where the local changes came from, if you didn’t change anything. But to remove all local changes and return them to the state in which they are in the repository, you can execute the following command:

 git reset --hard HEAD 

But be careful, if you made some important changes and did not fix them, they will also disappear.


I also recommend that you familiarize yourself with this issue in the English part of SO, various options are considered there, why modified files may appear after git clone .

  • Read the decision of the author. How do you worktree = / ? )) - Nick Volynkin ♦
  • @NickVolynkin, I honestly do not even know what it is :) - ixSci
  • If I understand the documentation correctly, then this is a global config that says "the work area of ​​any project is in / ". - Nick Volynkin ♦

After deleting the terms worktree = / in global confige gita, the project after the clone was displayed correctly, the solution @ixSci may be correct, and

 git reset --hard HEAD 

would help.