Using git branches for variations of a project

Posted by Trevor Hartman on Stack Overflow See other posts from Stack Overflow or by Trevor Hartman
Published on 2010-04-14T20:28:54Z Indexed on 2010/04/15 0:33 UTC
Read the original article Hit count: 379

Filed under:
|
|

I'm using git's branching feature to manage 5 variations of a small website. There are 5 versions that will all be live in different subdirectories on production. My approach to checking out the various branches to their respective folders was to:

mkdir foo && cd foo
git init
git remote add origin git@...:project.git
git fetch origin foo:foo

Where "foo" is a given branch name. This was fine, except for that it pulled my entire repo (designs, as3 source, etc...) into those branch folders instead of just the public www folder, which is the only thing I really want on production.

Is there a cleaner way to handle this? Git can't clone subdirectories right?

© Stack Overflow or respective owner

Related posts about git

Related posts about Workflow