Using git branches for project options

I use the git branch function to manage the 5 options of a small website. There are 5 versions that will live in different subdirectories at the factory. My approach to checking the various branches in their respective folders was as follows:

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

Where "foo" is the given name of the branch. It was perfect, except that he pulled all my repos (projects, as3 source, etc.) into these folders folders, not just the public www folder, and this is the only thing I really want in production.

Is there a cleaner way to handle this? git can't clone subdirectories correctly?

+3
source share
3 answers

, DVCS (/ ) ( , )

www (Git) subRepo (Mercurial).
, .


( , ), "" (release_foo foo), , www.
foo , release_foo , .
, .


, , Git1.7:

read-tree "" , .git/info/sparse-checkout.

.git/info/sparse-checkout , (, foo).
, :

  • - "" .
+2

, .

(html, php, js, img ..) . ​​ . script, //etc . , , , .

+1

(AFAIK) a git . . git, , / , . .

0
source

Source: https://habr.com/ru/post/1741163/


All Articles