Hi John,

On Jan 28, 11:34 pm, jschank <[email protected]> wrote:
> Hi Yuval,
>
> My goal is more to avoid pushing to my central repo, until I'm ready,
> but also to provide a redundant copy of my "local" state. I suppose
> this could be done with pure git, by having a public central repo that
> is pushed to, but then a private repo that gets "blessed" commits. But
> I think that is over-complicating the scenario.

I think you *are* overcomplicating it.  What I would suggest is a
single repo.  And setup a central repo that you can consider your
'master' or 'remote backup' if you will.  The keep the master branch
in your git repo as the 'blessed' version of your code, where only
approved, tested, whatever commits get merged to.

Setting up a remote repo that you can push to is easiest with GitHub
(for a few dollars a month for private repo access).  However you can
also do this pretty easily and for free if you have a remote server
that you can access via SSH.

Here are a couple of links to get you going on that.

http://toolmantim.com/articles/setting_up_a_new_remote_git_repository

Gitosis
http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way
http://eagain.net/gitweb/?p=gitosis.git;a=blob_plain;f=README.rst;hb=HEAD


Then create a working branch off of that master which is where you do
ALL of your work.  You can make as many commits there as you please.
When you want to save your work in progress you just push the working
branch to your central repo as well.  This also makes it easy to do
things like work at the office, and then pick up where you left off at
home with a simple git pull from the central repo.  When you are ready
you can merge your working branch back to master at any time.  Or
conversely you can bring your working branch in line with master with
'git checkout working-branch-name' and 'git rebase master' which will
merge in all recent changes from master to your working branch and
then re-apply your working commits on top of the master branch
commits.

>
> Essentially, I want to work locally, with lots of local commits, and
> then incremental pushes (using sqashed commits I believe) so the main
> repo has feature complete updates. BUT I want to be able to recover
> from a local catastrophe without losing any work.

Since every git repo is a full clone of other repos, if you push to
one or two other remote locations you will have a secure backup which
you can insure the integrity of since git does sha1 hashing on every
commit in the repo.  Because of this fact I think it is safer to git
push your content to a remote repo rather than rsync or another file
based copy method.

>
> I'm wondering if I can just copy the .git directory and that's all I
> need, or is there a "better" git way to do this
>

Yes, the above comments represent the better 'git way' of doing it
though IMHO.

Cheers
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"GitHub" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/github?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to