Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to revert changes in Idea IDE

I have several files shown as changed. If i revert changes nothing happens. If I remove them from disk and then run git checkout -- . from console they shown as changed again.

How to tell Idea to forget about them?

Other actions (like pull, commit and push) works fine.

OS: Windows 7.

$ git config core.fileMode
false

$ git status
# On branch bugfix/XXXXX
nothing to commit (working directory clean)
like image 882
talex Avatar asked Dec 09 '22 06:12

talex


2 Answers

I guess the problem is with file modes! I faced the same thing some time back when I moved my development to Windows.

Try running git config core.fileMode false and then check!

Hope it help!

like image 101
Mudassir Razvi Avatar answered Dec 10 '22 20:12

Mudassir Razvi


  • By using git status we can find out each file status (modified, not modified).

  • In our project, temporary files frequently change. In this case, git repository says our files are untracked or modified. For this we have to add these files to .gitignore to ignore them.

    We have to execute some commands. Please refer to this question and check the following commands.

    git reset HEAD filenamewithpath -> unstaging a staged file
    git checkout -- filenamewithpath -> unmodifying a modified file
    
  • You can find the relevant technology's .gitignore files in this GitHub repository.

  • To ignore the files which we mentioned in the .gitignore file, we have to execute the following commands.

    git rm -r --cached .
    git add .
    git commit -m ".gitignore is now working"
    
like image 23
Anjaneyulu Battula Avatar answered Dec 10 '22 20:12

Anjaneyulu Battula