Last active
December 11, 2015 07:19
-
-
Save dantoncancella/4565669 to your computer and use it in GitHub Desktop.
Create a git repository DreamHost
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Clone from the remote repository | |
[other ~]$ git clone ssh://[user@]host/~/project.git |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create the local repository | |
[local ~]$ cd project | |
[local project]$ git init | |
[local project]$ touch .gitignore | |
[local project]$ git add . | |
[local project]$ git commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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