Information Technology Reference
In-Depth Information
11-4. Hosting git repositories over ssh
Problem
You want to set up a host that will be used within your company to share git repositor-
ies. Your task is:
• To set up a virtual machine for hosting git repositories
• To install the repository created in Recipe 3-1 on a virtual host in such a
way that every developer can clone, fetch, and push using this repository
• To check that everything works as expected by committing and pushing to
the remote repository stored in the virtual system
Hint With this recipe you can host private git repositories even if you don't have ac-
cess to the root account. You can use this recipe for virtual shared hosts, for example.
Solution
Start the virtual machine:
# Host OS (e.g., Windows, Linux, OS X)
$ cd git-recipes
$ mkdir 11-04
$ cd 11-04
$ vagrant init precise32 http://files.vagrantup.com/
precise32.box
$ vagrant up
$ vagrant ssh
Install git on the virtual machine:
# Guest OS (Ubuntu 12.04)
$ sudo apt-get install -y git
The virtual machine is ready. You can close the ssh session:
Search WWH ::




Custom Search