Skip to content

Instantly share code, notes, and snippets.

@smahi
Last active August 29, 2015 14:01
Show Gist options
  • Save smahi/ef60175356440dc2cfb6 to your computer and use it in GitHub Desktop.
Save smahi/ef60175356440dc2cfb6 to your computer and use it in GitHub Desktop.
How to create your own git server

Creating Git server

Install git-core

$ sudo apt-get update
$ sudo apt-get install git-core

Create git user

$ sudo adduser git

Create the repo on the server

$ su git
$ git init --bare myproject

Create the project on the client

$ mkdir myproject
$ cd myproject
$ git init
$ touch README.md
$ git add .
$ git commit -m "Initial comit"

Pushing the project to the server

$ git remote add origin ssh://git@the_server:prot_number/home/git/myproject
$ git push origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment