1. Download and compile and install gitwgethttp: // configure (use the -- prefix parameter to specify the Git installation path) makesudomake
1. Download and compile and install git
Wget http://kernel.org/pub/software/scm/git/git-1.7.5.4.tar.bz2
Tar-xlvf git-1.7.5.4.tar.bz2
Cd git-1.7.5.4
./Configure -- prefix =/usr/local/(Use the -- prefix parameter to specify the Git installation path)
Make
Sudo make install
Run the following command to check whether git is successfully installed.
Git -- version
Related reading:
Configure Apache + FastCGI (mod_fastcgi) + PHP http://www.linuxidc.com/Linux/2012-02/53418.htm on RHEL 5.3 (Tikanga)
Build PHP + Memcached http://www.linuxidc.com/Linux/2012-02/53421.htm in RHEL 5.4 (Tikanga)
Configure Apache + FastCGI (mod_fcgid) + PHP http://www.linuxidc.com/Linux/2012-02/53419.htm on RHEL 5.3 (Tikanga)
Ii. Install gitosis(In fact, the permission manager of Git includes gitosis and gitolite. Please refer to this article:Http://www.linuxidc.com/Linux/2012-02/53420p2.htmHere I select gitosis)
Download and install setuptools
Wget http://dl.atrpms.net/el5-i386/atrpms/stable/setuptools-0.6c2-5.0.el5.noarch.rpm
Sudo rpm-ivh setuptools-0.6c2-5.0.el5.noarch.rpm
Use Git to download and install the source code of gitosis(The gitosis project uses Git to manage source code)
Git clone git: // eagain.net/gitosis.git
Sudo python setup. py install
3. client-side Key Generation(The premise of this step is that the client needs to install Git based on different operating systems attached here:Http://git-scm.com/)
Use the following command in the. ssh directory to generate a private/public key pair:
Ssh-keygen-t rsa
Copy the generated public key id_rsa.pub to the/tmp/directory on the server.
The detailed operation steps of the Windows client are attached:
Open the C:/Documents and Settings/Administrator/. ssh directory(If there is no. ssh directory, you can create one)
Right-click Git Bash and then execute the ssh-keygen-t rsa command.
After successful execution, you can use the PSFTP provided by Putty to upload id_rsa.pub to the server.
(If there are multiple private/public key pairs in the. ssh directory or you want to use an existing key pair, create an ssh configuration file named config in this directory to specify:
Host www.gitserver.com
User git
Port 22
Hostname www.gitserver.com
IdentityFile ~ /. Ssh/id_rsa
IdentitiesOnly yes)
4. Configure gitosis
Create an account named git
Sudo/usr/sbin/adduser git
Sudo su-git
Gitosis-init </tmp/id_rsa.pub
If the operation is successful, the following output is obtained:
Initialize empty Git repository in/home/git/repositories/gitosis-admin.git/
Reinitialized existing Git repository in/home/git/repositories/gitosis-admin.git/
Chmod 755/home/git/repositories/gitosis-admin.git/hooks/post-update
5. Create a code repository on the client and synchronize the repository to the Git server.
Git clone git@www.gitserver.com: gitosis-admin.git
Vim gitosis. conf
[Group Android-projects]
Writable = android-projects
Members = Administrator @ LEI(The value must be the same as the file name in the gitosis-admin/keydir directory)
Git commit-a-m "Allow Administrator @ LEI write access to android-projects"
Git push
Mkdir android-projects
Cd android-projects
Touch README.txt
Git add.
Git commit-a-m "Initialize android-projects"
Git remote add origin git@www.gitserver.com: android-projects.git
Git push origin master