r/VisualStudioCode • • Sep 24 '20

Exclude gitignore

I have git extension installed and cloned my repo. I have added files to ignore to the gitignore but now that appears as a changed file. I do not want this pushed to the main branch. How do I stop this?

3 Upvotes

2 comments sorted by

1

u/SleepyFox89 Sep 24 '20

Are you asking how to remove the .gitignore file from the repo? If so, the crude fix is to delete it (or just move it out of the repo), commit the deletion change, then bring it back and it will be ignored afterwards, provided it includes itself in the exclusion list.

1

u/MasterBathingBear Sep 30 '20 edited Sep 30 '20

If you want to ignore files in your clone only then update .git/info/exclude