How does git clone Gitlab? How does the Git local repository upload gitlab?

Source: Internet
Author: User

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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.