On Tue, 31 Dec 2013 04:33:22 -0800 (PST)
Maciej Reguła <matias...@gmail.com> wrote:

> I'am new to git and I couldn't find answers anywhere for my questions
> so here I'am.
> 1. When I create local repository i.e for my own "framework" and then
> I build websites based on this framwerok, these websties should be
> different branches?

"It depends".

The usual (most common) approach is to consider framework a library and
hence maintain it in a separate repository.  The project which use it
do this by means of Git submodules [1].  If you'll find submodules to
be too heavy-weight or inconvenient, consider using subtree merging [2].

On the other hand, for simple stuff this might be too heavyweight for
no reason.  "Simple stuff" means your framework is so simple and/or
specialized you will never want to use it for more than one or two
projects so that having it in the same repository as these projects is
okay.  If so, then yes, you might use the ability of Git to create
branches rooted at nowhere (read up on the "--orphan" option of the
`git branch` command).  Then you might first cook your framework code
on a branch and then create a fresh orphan branch for a project [3] and
then merge your framework into that project branch.  You might then do
integration merges if your framework changes.

Note that should you opt for such multi-branch scheme it worth keeping
the framework in a separate directory or at least not modify its files
heavily in the dependent projets otherwise you'll have merge conflicts
when doing integration merges.  Using submodules or subtree merging
implies this approach anyway.


Will try to address the other question later -- have no time at the
moment for a comprehensive reply, and terse replies suck.

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to