Build a git server under linux

1. Add the git user
useradd -m git
2. Modify the git user password (the password is git)
passwd git
3. Unzip git-1.7.12.2.tar.gz and install git
tar -xvf git-1.7.12.2.tar.gz
cd git-1.7.12.2
make
make install
4. Initialize the git user to prepare for installing gitosis. When using git on any machine, you must initialize it for the first time:
git config --global user.name "git"
git config --global user.email "[email protected]"
5. Install setuptools-0.6c8 .tar.gz, prepare for installing gitosis
tar -xvf setuptools-0.6c8.tar.gz
cd setuptools-0.6c8
python setup.py build
python setup.py install
6. Install gitosis.tar.gz
tar -xvf gitosis.tar .gz
cd gitosis
python setup.py install
7. Use eclipse to generate a public key, or use the following command to generate a public key in linux
ssh-keygen -t rsa
The key is generated in the /home/git/.ssh directory
8. Use the git user to log in to initialize the warehouse
su – git
gitosis-init < /home/git/.ssh/id_rsa.pub
9. Modify
chmod 755 \
/home/git/repositories/gitosis-admin.git/hooks/post-update
10. Use eclipse to access the administrator warehouse gitosis-admin.git



11. Import the gitosis-admin.git warehouse as a project into eclipse and add a user By adding the public key in the keydir directory (commit after adding), the read and write permissions can be modified by modifying the gitosis.conf file (commit after modification)


12. Create a warehouse (the code we submit is submitted to this warehouse)
mkdir runtime. git
git init --bare
13. Modify the gitosis.conf file, increase the permission to access the runtime.git repository, and use eclipse to access the runtime.git repository.
Modify as follows:
[gitosis]

[group gitosis-admin]
writable = gitosis-admin
members = RSA -1024

[group developer]
writable = runtime
members = RSA-1024






Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326139642&siteId=291194637