What I want to do: On my (ssh remotely accessible) university machine I work on a project which I have put under git source control (git init
, then git commit -a
after every change, all works fine). Now I want to want to work on that project on my private machine at home. Should be easy, since git is a distributed vcs, right?
I read the git tutorial, which suggests to do a git pull
at university to get the changes done at home. That won't work, since my machine at home is not remotely accessible. So I thought that I'd do a git push
at home. That works, but it's complicated (requires git reset
at university afterwards, etc.), since non-bare repositories are not designed for pushing.
Question 1: Is there an easier way than adding a additional bare repository to my setup (which would mean that I had: (1) the "main" bare repository, (2) the university working copy, (3) the home working copy)?
<Rant>If I really need that setup, I could have stayed with SVN.</Rant>
Question 2: If that setup is really needed, how do I create that bare repository (git clone --bare
, I guess) and make it the "main" repository, i.e., tell the working copies that git push
is supposed to go there.
PS: I know that there's a post-receive hook floating around that allows you to push into non-bare repositories. I tried it, but it didn't work well since the git version on the university machine is quite old (1.5.5.6) and misses some commands used by the hook. Updating is not an option, and I'd prefer a solution without third-party scripts anyway.