The CentOS build git needs to set up remote server and client. Remote code resides on the server side, and multiple clients can share and maintain service-side code.
First, server-side host
1. Create SSH, most of which are installed by default and have SSH skipped
Yum Install Openssh-server-y
2. Install git
Yum-y Install Git-core
3.1 Creating a Git user
Useradd git
3.2 Setting a password
passwd git
4. Git User Login
Su git
5. Initializing the server-side warehouse
Cd/home/git
Git init-–bare web.code.git
Web.code.git for the library name
Assume that the server IP is 192.168.1.222,git service address is: [E-mail Protected]:/home/git/web.code.git
The server is OK.
Second, the client computer
1. Install git
2. Cloning server-side repositories
git clone [email protected]:/home/git/web.code.git web.code
Clone the server-side warehouse and place it in the local directory Web.code.
3. Basic Configuration
git config--global user.mail "[Email protected]"
git config--global user.name "user_name"
4. Now it's ready to use.
The default is only the Master branch. We can create our own branches, create files, submit files, merge branches, and submit them to the server.
CentOS builds git server and client