Q:

Should I ignore *.layout and *.dependent from a .gitignore rule?

I am working on a C++ project with Code::Blocks. I notice that there are some *.layout files and *.dependent files. 
Should I add them to .gitignore? 
Edit:
I am also most sure that I can/should ignore *.layout files. But how about *.dependent?

A:

Generally, files that are generated, either for your convenience or during the course of the build process, should always be excluded with an ignore rule.  The actual question is where to put these ignore rules, and Git gives you two options here:
You should not add rules that are specific to your work environment to .gitignore.  A better place for such ignore rules is .git/info/exclude, which is local to your repository clone, but otherwise works just like .gitignore does.
In your case, the files in question are for an IDE that maybe nobody else on the team uses.  An ignore rule such as *.layout might not even make sense to other developers and confuse them.  So it is better to keep these exclusions private to your repository clone.
However, files that appear in the working copy independent of individual developer tools should be excluded via .gitignore; an example for that would be typical compiler artefacts such as .o files.
Keep .gitignore clean for others and don't put your own specific rules in there.  Obviously, if everybody on your team was using Code::Blocks, then it would be OK to exclude *.layout files in .gitignore (everybody needed that rule anyway, and it is unlikely that the rule would confuse people).
Finally, it might make sense to keep certain meta-information for IDEs under version control; an example for this are the .project files that Eclipse uses – if these are portable between developer machines, and only if everybody is expected to save and restore from the same .project file.  This really would be a matter of discussion in your team.
This is more a piece of "style advice" than a hard-and-fast rule.

