Skip to content

Instantly share code, notes, and snippets.

@dantoncancella
Last active December 11, 2015 07:19
Show Gist options
  • Save dantoncancella/4565669 to your computer and use it in GitHub Desktop.
Save dantoncancella/4565669 to your computer and use it in GitHub Desktop.
Create a git repository DreamHost
# Clone from the remote repository
[other ~]$ git clone ssh://[user@]host/~/project.git
# Create a bare remote repository
[local project]$ ssh [user@]host
[host ~]$ mkdir project.git
[host ~]$ cd project.git
[host project.git]$ git init --bare
[host project.git]$ exit
# Create the local repository
[local ~]$ cd project
[local project]$ git init
[local project]$ touch .gitignore
[local project]$ git add .
[local project]$ git commit
# 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
# Setup SSH keys
[local ~]$ ssh-keygen -t rsa
[local ~]$ ssh-copy-id [user@]host --> OSX users: cat ~/.ssh/id_rsa.pub | ssh user@machine "mkdir ~/.ssh; cat >> ~/.ssh/authorized_keys"
[local ~]$ eval `ssh-agent`
[local ~]$ ssh-add
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment