1

Below is the image of my project structure:

enter image description here

I would like to delete .vs folder, packages folder, .hgignore file and bin and obj directories under Leapfrog.Datafetcher, Leapfrog.Test, and src/LeapfrogDataService.

As of now, my .gitignore file looks like

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
packages
.hgignore

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/

# Visual Studio 2015 cache/options directory
.vs/

Can anyone let me know what is missing in a .gitignore file or is there anything wrong with my path?

tRuEsAtM
  • 3,517
  • 6
  • 43
  • 83
  • A thread on StackOverflow already explains it how to do: https://stackoverflow.com/questions/4308610/how-to-ignore-certain-files-in-git – Cheena Malhotra Jul 11 '17 at 18:24
  • Possible duplicate of [How to ignore certain files in git?](https://stackoverflow.com/questions/4308610/how-to-ignore-certain-files-in-git) – Lasse V. Karlsen Jul 11 '17 at 18:48

1 Answers1

2

.gitignore will not delete anything. All it does is ignore certain paths when you are trying to git add or git commit. If the files are already being tracked by git, adding them to .gitignore will prevent you from making further changes (in git) to those files, but it won't delete existing history.

If you want to remove these files from your repository, you need to use git rm (or git rm -r to recursively remove a directory and its contents).

Dan Lowe
  • 51,713
  • 20
  • 123
  • 112