oren / openblog

https://oren.github.io/openblog
0 stars 0 forks source link

Setup a private git repository without github #2

Open oren opened 8 years ago

oren commented 8 years ago

git

First get a server. It can be a desktop at your home with public network access or Digital Ocean, AWS etc. It doesn't matter as long as you can ssh into it.

on the server

ssh user@ip
mkdir project.git
cd project.git
git init --bare

locally

mkdir -p project.git
cd project.git
git init
git remote add origin user@ip:~/project.git
git push -u origin master

If you want someone to contribute as well, add his/her public key to ~/.ssh/authorized_keys on the server. The public key can be found on github.com/github-user-name.keys