0

I do not understand if it is a VSCode issue or a git issue. I would bet on the latter...

We know that VSCode stores files history under .history directory.

As I noticed that the history files were also tracked by git (I guess I should have avoided this situation but I didn't...), I added

.history/*

to the .gitignore file.

Now I can see many files from history under the "changes" topic marked as deleted:

enter image description here

PS C:\Users\myuser\WebAppsProjects\BBSim> git status
On branch add-openapi
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        deleted:    .history/pom_20201018121439.xml
        deleted:    .history/pom_20201018154533.xml
        .....
        .....

I tried to stage them and commit, but the operation failed because history is under .gitignore...

How can I handle this situation (using VSCode or git bash) ? As you understand, I don't want to track those history files...

Thanks!

dushkin
  • 1,939
  • 3
  • 37
  • 82
  • 1
    So I guess you will need 2 things to do: `1.` ignore the files as you did or (in my opinion much nicer) with a global .gitignore `2.` follow this link [How to make Git “forget” about a file that was tracked but is now in .gitignore?](https://stackoverflow.com/questions/1274057/how-to-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitignore) – caramba Nov 19 '20 at 18:40
  • @caramba YES YES YES!!! Thank you! – dushkin Nov 19 '20 at 20:01

0 Answers0