I’m guessing this is only relevant to a few users out there, but I’m still getting comfortable with git and OF.
I was wondering what peoples’ .gitignore files look like. There is one simple thing I still don’t completely understand, which is: how to include the contents of a bin/data folder but not the contents of /bin directly? I thought it was simply bin/* and !data/ but that doesn’t do it: things inside data/ are still assumed to be excluded.
Here’s a .gitignore for a project that has XCode and Linux Code::Blocks projects, and some things that were imported from subversion but now managed on git:
(Maybe this belongs in “General discussion”?)
git is awesome
concerning your problem see the second bullet point here: http://www.kernel.org/pub//software/scm-…-gnore.html
it’s very instructive to look at the .gitignore files in the oF root and /addons directories, and compare, to see how they only include the official addons.
maybe also some additional info at http://progit.org/book/ch2-2.html http://help.github.com/git-ignore/
hmm not sure how the second point answers the !data/ question… unless you’re saying i should explicitly add a .gitignore with !* inside the data/ folder?
here’s the OF .gitignore, for reference http://github.com/openframeworks/openFrameworks/blob/master/.gitignore
actually, now that i read through i realize they did it the opposite way. instead of blocking bin/ and allowing data/, they just explicitly block any executable files.
then in some examples they even have a .gitignore with “*” in the data folder, which doesn’t really make sense to me either. maybe if the app constantly spits stuff into the data folder, you wouldn’t want to use git to manage this.
[quote author=“kylemcdonald”]hmm not sure how the second point answers the !data/ question… unless you’re saying i should explicitly add a .gitignore with !* inside the data/ folder?
Yes, that should do the trick nicely. If not, experiment a bit.
Sent from my phone
yes i haven’t found a good solution for that, for the OF repo i imported everything from svn and then added the gitignores so everything was there already but i’ve found later that it’s problematic to add new things since you have to force every file.
in the .gitignore of the folder you want to exclude from the parent .gitignore should include everything recursively but then it’s problematic with other files that you want to ignore inside that folders