1

When i push my code to github version control system, it includes with following files, which i don't want to be there in github repository. I have tried to customize .gitignore file to exclude these files but that did not help. What is the way to tell visual studio not to be included these files in "Team Explorer" property. I had to unstage these files to push the commit to the git repo.

Team Explorer Property

Github Repo

Urgen
  • 1,095
  • 3
  • 19
  • 39
  • If the files were committed before adding to .gitignore, they remain commited. I think you can fix this by deleting them and then commiting the empty folder. If that doesn't work, I suggest making a new repo, and commiting to that one, having configured .gitignore before the files exist. Of course this would mean that you would loose your commit history. – tutiplain May 10 '19 at 15:08
  • If you git ignore is at the root of the solution then something like this in the git ignore: [Bb]in/ [Oo]bj/ – Daniaal May 10 '19 at 15:31
  • Thank you guys for the reply, i had to recreate the git repo again to fix it. – Urgen May 10 '19 at 16:20

1 Answers1

0

To Ignore files already committed. you need to

  1. Edit .gitignore: to match files you need to ignore
  2. Execute : git rm --cached /path/to/file

Resources :

  1. Untrack files already added to git

  2. Applying .gitignore to committed files

  3. Remove a file from a Git repository without deleting it from the local filesystem

Rihcodo
  • 17
  • 7