Linux system how to build a local git server, for the team to store the development code, the following steps:
1. Install git with one server first, install Linux, and choose Ubuntu 14.04 here. Then configure the static ip:172.16.0.110. Execute the following command:
>> sudo apt-get install git
2. Create a git User:
>> sudo adduser git
3. Create a/home/git/.ssh/authorized_keys file and copy the ~/.ssh/id_rsa.pub file of each team to the above file, one at a-line.
4. Create a git repository in the/srv directory:
>> CD/srv>> sudo git init--bare ourwiki.git
If you are building a git repository remotely, log on to the server first (guaranteed to be the same LAN):
>> ssh [email protected]172.16. 0.
Then proceed to the above steps.
5. Modify the owner of the GIT repository:
>> sudo chown-r git:git ourwiki.git
6. Cloning the project:
>> git clone [email protected]172.16. 0.110:/srv/ourwiki.git
7. After cloning (empty folder, you must add a small file, general Readme.txt can, submit the following code to execute later):
Submit Code:
>> git add-A>> git status>> git push Origin master
After cloning, switching branches can be created (switching to a branch that does not automatically creates a branch):
>> git checkout-b release
The same way you create a readme document, submit it.
Build a git server locally under a Linux system