Github


#1

Maybe some of this is too basic, or maybe I have got my workflow completely wrong but I have a few questions about using github.

For the last few versions I have just downloaded zip files from github for addons, and added them into my addons directory.

I decided to start fresh with 0.74 and re-collected my addons from github- with the hope I can pull updates and switch branches of both OF and my addons.

So far so good.

My questions are when addons are made as per the OF addons guidelines can I leave the examples in their folders as they come from github and run them from there to test and learn? If the git’ed addons only contain a src folder and I make a project within the folder, if I update the addon and its src folder will the new files (prject and settings files for xcode) remain intact?

If I switch to the dev branch of OF will all my addons remain intact?

Is there a way to migrate addons to a new version of OF if one is released and I want to keep the old version intact, without downloading them again- as far as I can tell if I change location they are seen as missing- if I again pull the master of an addon from git (using the git app) I do get 2 copies if my local destination is different but I cannot find a way to tell which is which. Is there a simple way around this?

For addons or libraries that have a different file layout is there a way to tell git to download some parts of the repo to different locations so I can still synchronise or switch branches but end up with the files where I want?

Sorry for all the questions but I am trying to get a clean and flexible version of OF running before I start working with it. I have read through the GIT help but not found direct answers to these questions.

Cheers


#2

can I leave the examples in their folders as they come from github and run them from there to test and learn?
yes, the only relevant location parameter is the folder depth from the OF root directory, and that’s the same for /addons/someaddon/someexample/src and /examples/3d/someexample/src and /appsy/myApps/someapp/src

If the git’ed addons only contain a src folder and I make a project within the folder, if I update the addon and its src folder will the new files (prject and settings files for xcode) remain intact?
this depends on the gitignore settings of the addon (i assume you talk about an addon’s example’s src folder here). usually, for addon examples, the project files are also in the git repo (as opposed to e.g. examples we ship with OF) because we can’t (yet) generate them automatically.

If I switch to the dev branch of OF will all my addons remain intact?
yes, the “unofficial” addons are ignored in the OF git repo.

Is there a way to migrate addons to a new version of OF if one is released and I want to keep the old version intact,
typically, you’d work with git repositories for both addons and OF - then you only have to check out different branches of the addons, or git tags. OF places git tags at the released versions, so you only have to “git checkout 0073” to get OF to version 0073. some addon authors do that for addons, too. you can also put git tags locally without pushing them online, so you can mark addon versions/commits that you know work with a specific OF version with tags to be able to go back there easily.
so, you only ever have one copy of an addon, but it contains all version, you just have to check out the one you want.

For addons or libraries that have a different file layout is there a way to tell git to download some parts of the repo to different locations so I can still synchronise or switch branches but end up with the files where I want?
nope, git repos are always self-contained in their folder.

also, check out this: https://github.com/openframeworks/openFrameworks/wiki/openFrameworks-git-workflow


#3

Thanks for such a comprehensive response. It helps a lot.

Cheers