It would be nice to have a more or less complete list over what files and/or directories that shouldn\'t (in most cases) be under source control. What do you think should be
Config files that contain passwords or any other sensitive information.
additionally:
Visual Studio
A lot of time has passed since this question was asked, and I think a lot of the answers, while relevant, don't have hard details on .gitignore
on a per language or IDE level.
Github came out with a very useful, community collaborated list of .gitignore
files for all sorts of projects and IDEs that is worth taking a look.
Here's a link to that git repo: https://github.com/github/gitignore
To answer the question, here are the related examples for:
There are also OS-specific .gitignore
files. Following:
So, assuming you're running Windows and using Eclipse, you can just concatenate Eclipse.gitignore
and Windows.gitignore
to a .gitignore
file in the top level directory of your project. Very nifty stuff.
Don't forget to add the .gitignore to your repo and commit it!
Chances are, your IDE already handles this for you. Visual Studio does anyway.
And for the .gitignore
files, If you see any files or patterns missing in a particular .gitignore
, you can open a PR on that file with the proposed change. Take a look at the commit and pull request trackers for ideas.
Temp files from editors.
.*.sw?
*~
etc.
Whatever the language :
And for those who don't know about it : svn:ignore is great!
I am always using www.gitignore.io to generate a proper one .ignore
file.