github questions - repo within a repo folder


right now my folder structures locally look like this:

– v0061
— apps
— addons
– v0062
— apps
— addons
– v0070
— apps
— addons

I am trying to move everything to using Github so I can contribute code back. I’ve forked OF in github, cloned my fork to my local v0070 folder.

I don’t want to keep addons I’ve made or downloaded in the addons folder. I know there is gitignore to not upload these, but I keep them separate more so I can see when a new OF version comes out which addons are not in the core that I want to use again, so I have a folder called addons-extended in this folder:

  • v0070
    – openframeworks
    — addons
    — apps
    ---- examples
    ---- work

I then cloned addons like ofxMidi from github into addons-extended. So now there is a ofxMidi repo inside the folder tree that is the openframeworks repo.

  1. Is this the correct way to do it? I can’t see any other way.

  2. Does a repo work that it includes any files/folders down the file structure from the root, so in the openframeworks folder it tries to include everything in its repo in every folder, unless specified in the .gitignore?

  3. I changed the .gitignore in the root of OF to ignore addons-extended. Does this .gitignore only apply to the openframeworks repo, not any others? I shouldn’t really change gitignore in the OF root as it would end up changing this file when i push to the server? Perhaps I just have a gitignore in the addons-extended folder?

  4. If I have ofxMidi repo inside addons-extended (within the of repo folder), if ofxMidi has a .gitignore will the OF repo read this file too, or ignore it because of the gitignore higher up the tree?

  5. Does gitignore anything in the apps folder that isn’t examples ?

Many thanks

p.s i’m finding it a bit easier to get started using Github for Mac over Tower at the moment, I’m guessing Tower is aimed at the more advanced user.


no need for that actually. look at openFrameworks/addons/.gitignore - all “offical” addons are mentioned there (so that they are un-ignored). This could potentially eliminate all the problems you have.

  1. yes, except that empty folders can not be tracked by git. (if you need an empty folder to be tracked, put an empty .gitignore in it)

  2. you could have a gitignore in addons-extended ignoring everything.

  3. that’s a tricky one, because git reads (afaik) the directory tree backwards, so that excluded stuff can be un-excluded (see the root and /addons .gitignore regarding the addons directory for how that works.
    Basically, I don’t know what happens. but just drop it in and you will see in tower

  4. It ignores _every_thing except stuff that has an exclamation mark in /apps/.gitignore (+ some finetuning regarding project files). Same deal as with addons.

Yeah, I know. tricky, but elegant. 8)