[KyOSS Discuss] Question about working with GIT from several locations

alan blount alan at zeroasterisk.com
Mon Dec 17 16:35:41 EST 2012


Agreed... just to put some details on what Jeff said:

     --bare
           Make a bare GIT repository. That is, instead of creating
<directory> and placing the administrative files in <directory>/.git, make
the
           <directory> itself the $GIT_DIR. This obviously implies the -n
because there is nowhere to check out the working tree. Also the branch
           heads at the remote are copied directly to corresponding local
branch heads, without mapping them to refs/remotes/origin/. When this option
           is used, neither remote-tracking branches nor the related
configuration variables are created.




cd /var/git

mkdir projectname
cd projectname
git init --bare

*or*

git clone --bare projectpathurl projectname

cd /var/www/productionsite
git clone /var/git/projectname
git checkout master


also, you can name your remotes anything you like... make a list of them in
2 columns:

origin github:/user/project
chris-dev machinename:/var/git/projectname
jeff-dev machinename:/home/user/projectname
etc...

then you can add whichever remotes you want like

git remote add jeff-dev machinename:/home/user/projectname

then you can fetch/pull/push to/from any remote, just like origin

git pull jeff-dev release-branch-1.5


thanks,
-alan









On Mon, Dec 17, 2012 at 3:10 PM, Chris Rockwell <chris at chrisrockwell.com>wrote:

> That does make sense, thank you.  I think I've decided my initial set-up
> will have the main repo on the server in our offices, which would give me 4
> copies all on different machines.  It seems a little daunting at first, but
> I think if I'm very deliberate and get used to git diff and get status,
> this will end up being a much more productive set-up than what I'm doing
> now.
>
>
> On Mon, Dec 17, 2012 at 4:00 PM, Jeff Squyres <jeff at squyres.com> wrote:
>
>> I guess I should clarify my statement: your checked-out version that is
>> running in production should not be the main repo.  You could have the main
>> repo on the same server, though.
>>
>> The main repo should be a "bare" repo; its sole purpose in life should be
>> to be the main hub (i.e., it's not checked out and no one works in it
>> directly).
>>
>> Make sense?
>>
>>
>> On Mon, Dec 17, 2012 at 3:59 PM, Chris Rockwell <chris at chrisrockwell.com>wrote:
>>
>>> Thanks Jeff.  I'll continue thinking about what should be the main hub.
>>> I do have a server at the office that is the exact same set-up as our
>>> production server which could be used.  I also found this:
>>> http://git-scm.com/book/en/Git-Basics-Working-with-Remotes which seems
>>> to be a pretty nice reference overall.
>>>
>>> Thanks again!
>>>
>>>
>>> On Mon, Dec 17, 2012 at 3:52 PM, Jeff Squyres <jeff at squyres.com> wrote:
>>>
>>>> I would not setup your production as the main hub, if possible.  If
>>>> you've got another 24/7 kind of server around, you should use that are your
>>>> main git hub.
>>>>
>>>> Then you can push/pull to that main git hub from any of your sites
>>>> without affecting (potentially) production.
>>>>
>>>> But yes, you can push between clones, too.  Hub-n-spokes is the easiest
>>>> topology to think about, but git is really more like a mesh -- any repo and
>>>> push/pull to any other related repo.
>>>>
>>>>
>>>> On Mon, Dec 17, 2012 at 3:14 PM, Chris Rockwell <
>>>> chris at chrisrockwell.com> wrote:
>>>>
>>>>> I'm considering using git to manage my 9-5 sites.  I am thinking that
>>>>> the production server should be set up as the main repo, and then I would
>>>>> need to clone to 3 different places: office, main testing server, home.
>>>>>
>>>>> However, my main question is: if I am working on a branch at my office
>>>>> that isn't quite ready, do I login to production, fetch (without merging)
>>>>> from my office, and then do a pull from home to get a copy of the branch?
>>>>> Or can I fetch between clones?
>>>>>
>>>>> --
>>>>> Chris Rockwell
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> KyOSS-Discuss mailing list
>>>>> KyOSS-Discuss at kyoss.org
>>>>> http://kyoss.org/cgi-bin/mailman/listinfo/kyoss-discuss
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> {+} Jeff Squyres
>>>>
>>>> _______________________________________________
>>>> KyOSS-Discuss mailing list
>>>> KyOSS-Discuss at kyoss.org
>>>> http://kyoss.org/cgi-bin/mailman/listinfo/kyoss-discuss
>>>>
>>>>
>>>
>>>
>>> --
>>> Chris Rockwell
>>>
>>>
>>> _______________________________________________
>>> KyOSS-Discuss mailing list
>>> KyOSS-Discuss at kyoss.org
>>> http://kyoss.org/cgi-bin/mailman/listinfo/kyoss-discuss
>>>
>>>
>>
>>
>> --
>> {+} Jeff Squyres
>>
>> _______________________________________________
>> KyOSS-Discuss mailing list
>> KyOSS-Discuss at kyoss.org
>> http://kyoss.org/cgi-bin/mailman/listinfo/kyoss-discuss
>>
>>
>
>
> --
> Chris Rockwell
>
>
> _______________________________________________
> KyOSS-Discuss mailing list
> KyOSS-Discuss at kyoss.org
> http://kyoss.org/cgi-bin/mailman/listinfo/kyoss-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kyoss.org/pipermail/kyoss-discuss/attachments/20121217/c953f141/attachment.html>


More information about the KyOSS-Discuss mailing list