Archive for May, 2010

Setting up a Git repo at Dreamhost

For some of the items I’m tinkering with lately, I’ve decided to have an offsite, secondary git repository. I followed the directions from this Dreamhost Wiki page to get everything up and running.

For the impatient among you (like myself), here are the absolutely essential parts:

?Download gitsetup.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Setup SSH keys
[local ~]$ ssh-keygen -t rsa
[local ~]$ ssh-copy-id [user@]host
[local ~]$ eval `ssh-agent`
[local ~]$ ssh-add
 
# Create the local repository
[local ~]$ cd project
[local project]$ git init
[local project]$ touch .gitignore
[local project]$ git add .
[local project]$ git commit
 
# Create a bare remote repository
[local project]$ ssh [user@]host
[host ~]$ mkdir project.git
[host ~]$ cd project.git
[host project.git]$ git --bare init
[host project.git]$ exit
 
# Push to the remote repository
[local project]$ git remote add origin ssh://[user@]host/~/project.git
[local project]$ git push origin master
[local project]$ git branch --set-upstream master origin/master
 
# Clone from the remote repository (optional...from another machine)
[other ~]$ git clone ssh://[user@]host/~/project.git