git installation, submit the code, cross-dense server SSH-free access

vmware server to prepare 3
192.168.5.136 Docker, Jenkins
192.168.5.137 Docker,
192.168.5.138 Docker,
192.168.5.139 Docker, git, Registry

 

1, Git installation, by

Variety of ways, the package can be mounted.

Yum install directly here

yum install git -y

 

2, create a Git user and password

- New user gitu 
useradd gitu

 - set user gitu password 
passwd gitu

 

 

3, create a Git repository

- Switch user gitu as 
su - gitu

 - create an empty folder 
mkdir hello.git

 - into the folder 
cd hello.git

 - initialize the folder for the git repository 
git --bare the init

 

 

4, access Git repository, and submit the information to the git repository

# git clone https://github.com/b3log/solo
# cd hello 移除旧的推送地址,添加新的: # git remote remove origin # git remote add origin [email protected]:/home/gitu/solo.git 提交代码到Git仓库并创建tag: # touch src/main/webapp/a.html # git add . # git commit -m “a” 创建标签: # git tag 1.0.0 推送到Git服务器: # git push origin 1.0.0 

 

 

5, clone git repository

- Cloning Download gitu user, warehouse address is 192. 168.5 .139 in / Home / gitu / hello.git, if the machines do not need to enter a password to avoid dense 
git clone gitu @ 192.168 .5.139: / Home / gitu / the Hello .git

 

6, SSH login avoid dense.

How it works: Each machine generates ssh key information, the public key information about the client, on their own machines, client to access than the public key, how consistent if no password authentication.

 

 

Reference: https: //blog.51cto.com/lizhenliang/2159817

Guess you like

Origin www.cnblogs.com/a393060727/p/12173637.html