A while back I figured out how to put a Git repository on my server. I’m pretty sure I was doing it wrong then – because at the time I didn’t know anything useful about “bare”.
So I’m trying again, reading along with ToolmanTim’s guide for the impatient
$ ssh myserver.com $ mkdir /var/git/myapp.git $ cd /var/git/myapp.git $ git --bare init $ exit
Add the remote repository and push:
$ cd ~/Sites/myapp $ git remote add origin ssh://myserver.com/var/git/myapp.git $ git push origin master
Yet when I do this the second time, the git remote add origin fails, saying it’s not really a git repo (at the other end, apparently, but I’m not sure).
Continuing the theme of impatience, I figure (correctly) that I can just write that stuff into my local config file instead of making git do the writing:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = ssh://myserver.com/var/git/myapp.git
fetch = +refs/heads/*:refs/remotes/origin/*
That worked for me.
Ah yes, that’s much better now. Thanks Toolman Tim!
effective date: 2009-06-01 04:22:04 UTC