Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/thecodesmith/git-server


https://github.com/thecodesmith/git-server

Last synced: 23 days ago
JSON representation

Awesome Lists containing this project

README

        

# Private Git Server

## Initialize Server

Create a user named `git` on the server. Run the [setup script](setup/server.sh)
for setting up a server on Ubuntu.

## Set up local SSH configuration

Add this setting to your local SSH configuration at `~/.ssh/config`:

Host tcs
User git
HostName thecodesmith.com

Of course, replace the `HostName` as necessary. The `Host` name can be set to
anything you like. I like abbreviations.

## Add local SSH public key to the server's authorized keys

Run this command, and enter the password created when setting up the `git` user
on the server:

ssh-copy-id tcs

Note: On Mac OS X, there is no ssh-copy-id command, so an alternative is this:

cat ~/.ssh/id_rsa.pub | ssh tcs "mkdir ~/.ssh; cat >> ~/.ssh/authorized_keys"

## Test Connection

Test the new Git server with the command:

git-create tcs:hello-world

This should create a repo called `hello-world` on the `tcs` server. It can now be used
like any other Git remote, for example pushing from a local repository:

git remote add private tcs:hello-world
git push -u private master

Or cloning the repository:

git clone tcs:hello-world