[Lumiera] Git question

Benny Lyons benny.lyons at gmx.net
Thu Jul 11 21:56:27 CEST 2013


Hi Hendrik, 

>With monotone, the working directory (where edit files and debug the 
> program) is separate from the database (which is the revision 
> management repository).  Whne you join a project, you first clone 
> the database, then set up one or more working directories that refer
>to the data base.
In Git, when you clone or do a giti init, Git creates a directory in the
current directory called '.git'.  This is where Git keeps its
'databank'.

> It's quite useful to have multiple workspaces; each can be used for 
> investigating a different bug, for example.
Git usually creates a branch for each workspace.

> It's quite useful to have multiple workspaces; each can be used for 
> investigating a different bug, for example.
Not too sure if I understand, but I'll try answering.

Here's a few ways of doing what I think you'd like to do:

Method 1: Branches
==================
One way of doing this is to branch.  For each workspaces, you have a
different branch.  Thus, 
    git branch workspace1      #Create the branch
    git checkout workspace1    #

So first clone from the main repo at lumiera.org, then create the branch
workspace1.
Now edit a few files.  When your finished, take alook at the files you
changed:
    git status -s
(The files listed 'M', are the files modified that you might like to
commit)
    git add mod_file_1 mod_file_2 ...
    git commit
So all your modifications are checked into the branch workspace1.

Now create a new workspace/branch
    git branch workspace2
    git checkout workspace2
You can edit, and check stuff into workspace2 as above.

The advantage of this method is that you can always easily compare files
between workspaces:

    git diff --name-status workspace1..workspace2

Now this will only show those files that are different between
workspace1 and workspace2
You also have 
    git log workspace1..workspace2
    git diff workspace1..workspace2


Finally, you can merge workspace2 into workspace1:
    git checkout workspace1
    git merge workspace2




Method 2: git-spaces
===========================================
Have a look at this: https://github.com/blakefrost/git-spaces

Method 3: Need to think a bit
=============================
Email later ....


Am Mittwoch, den 10.07.2013, 22:00 -0400 schrieb Hendrik Boom:
> Looking for advice as to best practice here.  I'm guessing something 
> like this is available, but I don't know how this is actually put 
> together out of the complicated git command options.
> 
> With monotone, the working directory (where edit files and debug the 
> program) is separate from the database (which is the revision 
> management repository).  Whne you join a project, you first clone 
> the database, then set up one or more working directories that refer to 
> the data base.
> 
> Those working directories contain the (perhaps edited) files of the 
> revision being worked on and smoe local status information, bit mostly 
> they just refer to the database.
> 
> It's quite useful to have multiple workspaces; each can be used for 
> investigating a different bug, for example.
> 
> Not I gather there's some way to do somehtig like this in git.  Of 
> course some cloned repository would take on the role of database, 
> but how does one get another (maye I should call it a virtual) clone to 
> refer to the first one so that the entire repository isn't duplicated?
> 
> -- hendrik
> _______________________________________________
> Lumiera mailing list
> Lumiera at lists.lumiera.org
> http://lists.lumiera.org/cgi-bin/mailman/listinfo/lumiera
> http://lumiera.org/donations.html




More information about the Lumiera mailing list