I'm trying to setup a .gitignore file to exclude a folder from my git repo, but I can't seem to figure it out.
I want to exclude the folder named Yarn in base directory.
.gitignore:
Yarn/
But the folder stills exist in my repo when viewing it on github.
Have I misunderstood something and this is not how to use .gitignore?
.gitignore
does not ignore files that are already committed and the fact that you see this folder in GitHub suggests that it was committed in the past. In addition to the (correct) entry in .gitignore
, you also need to remove this file from git:
$ git rm --cached Yarn