Git repos over multiple machines - backups and keeping in sync
Posted
by a-or-b
on Stack Overflow
See other posts from Stack Overflow
or by a-or-b
Published on 2010-04-30T00:35:52Z
Indexed on
2010/04/30
1:47 UTC
Read the original article
Hit count: 231
I'm new to git so please feel free to RTFM me...
I have multiple development sites (none of which can communicate via a network with each other) and am working on a few projects (with a few people) at any one time.
What I would ideally have is at each site a centralized repository that can be pulled from but development would occur in our own (personal) repos. Then I would like to be able to sync across the centralized repos (via USB key for example).
I want a centralized repo at each location as (1) I'm new to git and do break my (personal) local repo by playing around and (2) some projects get put on hold so I want to be able to free up disk space by deleting them. This is the "backup" part of my question.
I was also hoping to be able to use 'git clone --bare' for my centralized repos (and the USB key repos to?) as we don't need the full checkout, just the git benefits.
However I can't seem to get a bare repo to work as repo I can push from. I've used 'git remote' to set up an remote origin (similar to http://toolmantim.com/thoughts/setting_up_a_new_remote_git_repository) but I can't get 'git push' to work - it seems I need a checked-out repo.
.
Does anyone else use this sort of repo/development structure or is there something fundamental about git usage that I'm missing?
.
A solution that I thought about that might not work - If I had a 'git clone --bare' at each site and then use a git repo on my removable media which has remotes set up for each site then I could ('pull') sync my USB key with each repo. But then can I update the site repo from my USB key? Could I push from USB?
© Stack Overflow or respective owner