Hosting your git repo on your own server

This post was migrated over from Muziboo DevBlog. Hosting a git repo yourself is a very simple exercise. If you don't need (or don't want to pay for) features offered by github, you can setup your server to host your git repo. All you need is a server with ssh access. Here are the steps that you need to follow Login to your server ssh tom@example.com tom@example.com$ mkdir my_repo.git tom@example.com$ cd my_repo.git tom@example.com$ git init On you local machine, where you have your code $ cd my_code # cd to your code $ git init $ git add . # Adds everything. Use .gitignore to ignore some files $ git remote add origin tom@example.com:my_repo.git $ git push origin master Now you can clone tom@example.com:my_repo.git on any number of machines. To not share password, put your public keys on tom@example.com This approach gives you a basic git setup with ssh access (no http access). These steps should work on shared hosting too (as long as you have git available)

blog comments powered by Disqus
Hana Mohan
Hana Mohan