Add some file templates to one of the Git ignore files.
- The
.gitignore file .gitignore usually transferred with the repository, so ignoring it is used by all users. - The
.git/info/exclude file is not transferred to the repository, so it can be used for your own personal ignores.
To ignore the entire .js file in the foo directory, use something like this:
foo/*.js
Note that patterns in ignore files prevent file tracking. This means that if you have already made a file, it will continue to be tracked . The changes will cause the file to appear in your "uncommitted changes", and something like git commit -a will commit the changes.
If you have a dedicated file that you want to ignore in the future, you will have to remove it from the repository. This is a common question about SO, and there are many questions about it.
It is worth reading the Git function to ignore, as it has several fixes.
Chris
source share