Wednesday, October 12, 2016

How to Apply .gitignore File To an Existing Repository

When you update or add .gitignore file to not track unnecessary files, such as object files and binary files, this is what you can do to apply the change to an existing repository.

$ git commit -m "outstanding changes before applying .gitignore"
$ git rm -r --cached .
$ git add .
$ git commit -m "applying .gitignore"

That's it!

No comments:

Post a Comment