First make sure that the machine is installed on Git, and then confirm that you can access the Gitlab server properly.
Environment:
Git:centos 7.x 192.168.126.138
gitlab:centos7.x 192.168.126.137
1: Fill in GITLABN warehouse information
Login to Gitlab server address, new warehouse
After a successful creation, it will automatically jump to the page of the warehouse:
Above the red box, which is the warehouse address, we try to clone the warehouse to the local repository:
[[email protected] 123] #git clone http://192.168.126.137/root/accommate.git # 192.168.126.137 refers to the Gitlab server address, can be modified into a domain name, to see their hobbies
Cloning into ' accommate ' ...
Username for ' http://192.168.126.137 ': root #Gitlab Account
Password for ' http://[email protected] ': #Gitlab password
Warning:you appear to has cloned an empty repository.
Add the Gitlab repository to the remote list on this computer:
[email protected] accommate]# git remote add accommate [email protected]:root/accommate.git
[[email protected] accommate]# git remote
Accommate
Goodboys
Origin
Write a new file:
[[Email protected]/]# CD accommate/"This isTest txt-accommate" > Accommate
Submit the file to the local git repository:
" Add Accommate " [Master (Root-11 insertion (+100644 accommate
Then synchronize the local git repository to the remote git server (first, add the parameter-U, which represents the association local and remote):
[[email protected] accommate]# git push-u Origin masterusername for 'http://192.168.126.137': Root #Gitlab account password for 'Http://[email protected]': #Gitlab Password counting objects:3, done. Writing objects: -% (3/3),238bytes |0bytes/s, done. Total3(Delta0), reused0(Delta0) to http://192.168.126.137/root/accommate.git #上传的仓库* [NewBranch] Master,Masterbranch MasterSetUp-to-track remote branch master fromOrigin.
View the accommate on the Web side:
(Before uploading the file)
(After uploading the file), refresh the following Web page:
Look under what we wrote before:
Note: If uploading to GitHub, you need to define Ssh-key
How does git clone Gitlab? How does the Git local repository upload gitlab?