-2

I have a problem with removing modified files from git. When I do git status, it shows list of modified file which are not require to commit.

Lorenzo B
  • 33,216
  • 24
  • 116
  • 190
  • You want the file removed from the git repo and ignored moving forward? – Dave Newton Sep 01 '17 at 13:14
  • 1
    More context?!? Or a better explanation of what you want to achieve. – Lorenzo B Sep 01 '17 at 13:14
  • If you need an answer then [edit] the question and put more information in it. The output of `git status` together with what exactly you want, what you did and what doesn't work as you expect is a minimum that could change the question from a candidate to closing into a successful question. – axiac Sep 01 '17 at 13:17
  • A "modified" file is one that has been added to the repository and then was changed. Untracked files are ones that have not been added to the repository. You should update your `.gitignore` to exclude files that you want to be ignored for consideration. – crashmstr Sep 01 '17 at 13:26
  • Possible duplicate of [How do I configure git to ignore somes files locally?](https://stackoverflow.com/questions/1753070/how-do-i-configure-git-to-ignore-somes-files-locally) – phd Sep 01 '17 at 13:29

1 Answers1

4

Ideally, you should add .gitignore in your repo to be accidentally commit such unwanted files.

You can remove all unwanted modified files using below git command :

git checkout -f

Vinay Bagale
  • 2,361
  • 4
  • 36
  • 45