Article Title: git server in ubuntu. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Server:
A @ ubuntu :~ $ Sudo apt-get install git-core
A @ ubuntu :~ $ Sudo apt-get install openssh-server
A @ ubuntu :~ $ Sudo apt-get install openssh-client
The newly added git user will act as the administrator of all code repositories and user permissions:
A @ ubuntu :~ $ Sudo useradd-m git
Set a password for git:
A @ ubuntu :~ $ Sudo passwd git
Install the python setup tool to prepare for gitosis:
Apt-get install python-setuptools
Git clone git: // eagain.net/gitosis.git
Cd gitosis
Python setup. py install
Client:
Shh git @ Server
After logging on to the server
Mkdir example. git
Cd example. git
Git -- bare init
Cd
Ssh localhost
Exit
Client:
Generate an ssh key and upload it to the git server
Ssh-keygen-t rsa
Scp ~ /. Ssh/id_rsa.pub git @ server :~ /. Ssh/
Ssh git @ Server
Cat ~ /. Ssh/id_rsa.pub> authorized_keys
Chmod 755/home/git
Chmod 700/home/git/. ssh
Chmod 644/home/git/. ssh/authorized_keys
Chmod 755/www/git/repositories/gitosis-admin.git /\
Hooks/post-update
Exit
Mkdir example
Cd example
Git init
Touch README
Git add README
Git commit-m'first commit'
Git remote add origin git @ server: example. git
Git push origin master
I think it is too difficult for me to build a server on the Internet, but I think some of them are by default. At this stage, my linux is not very strong, just be stupid. to generate an ssh key and upload it to the git server, it must be on the client. I can't go through this process for a while.