On Tue, Mar 10, 2015 at 11:57:49AM +0100, Dimitry Sibiryakov wrote:
> 10.03.2015 10:36, marius adrian popa wrote:
> > My hope is that in the future to move all the repositories to github/git
> 
>    BTW, is it possible with GIT to have a single local copy of a
>    repository but several working directories for different branches?
>    Or I have to have several copies of repository on my HDD to work
>    with, say, FB 2.5 and 3.0 at the same time?

Depending on what exactly you want to achieve, you have few different
options:

- multiple cloned repositories; this is probably the easiest option to
  handle but not very space efficient one; if disk space is not an
  issue, I would probably prefer this (for example, I have now 10
  different checked out copies of linux kernel tree)

- if you want to save space (and network traffic for pulls), you have
  some options to share objects between cloned repositories; the one
  you would be probably most interested in would be

    git clone <old_copy> --reference <remote_url> <new_copy>

- there is also --separate-git-dir option allowing to separate work
  directory from the .git directory with objects; but I have no
  experience with that

However, there is seldom need for multiple working directories. I have
them for linux kernel tree but the reason is mostly only switching
between branches taking too long to be comfortable; in firebird git
repository, switching between 3.0 and 2.5 branches takes about half
second so that I can easily live with just one checked out clone.

The thing is, with git, local branches are cheap and work with them is
really comfortable, even if you need to reshape them substantially
before merge (tools like "git commit --amend", "git rebase -i",
interactive selection of hunks or even lines with "git gui" etc.).

                                                        Michal Kubecek


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to