GitHub\Gitee \GitLab \GitLab \ GitHub\ GitLab \GitLab \ GitHub\Gitee \GitLab

[TOC]

I met the Git

0. Content introduction

Git

  • Git introduction: Distributed version control tools VS centralized version control tools
  • Git installation: Based on the latest version 2.31.1 installation guide published on the official website
  • Git command: based on the development case explained in detailgitCommon commands of
  • Git branching: Branching features, branch creation, branch transformation, branch merge, code merge conflict resolution
  • The IDEA of integrated Git

GitHub

  • Creating a remote library
  • Code Push Push
  • The code pulls
  • Clone code
  • SSH Encryption-free login
  • The IDEA of integration making

Gitee yards cloud

  • Creating a remote library
  • The IDEA of integration making
  • The code cloud connects to GitHub for code replication and migration

GitLab

  • Setup and deployment of GitLab server
  • The IDEA of integrated GitLab

1. Git Overview

  • It-scm.com/
  • --everything is local: Distributed feature

Git is a free, open source distributed version control system that can handle projects from small to large quickly and efficiently

Git is easy to learn, small footprint, and extremely fast. It features inexpensive local libraries, convenient staging areas, and multiple workflow branches

It outperforms version control tools like Subversion, CVS, Perforce, and ClearCase

1.1 What is version control?

Version control is a system that records changes to the contents of a document so that future revisions to a particular version can be reviewed

The most important thing about version control is that it can record the history of file changes, so that users can view the historical version and easily switch versions

1.2. Why do YOU need version control?

Transition from individual development to team collaboration

1.3 version control Tools

Centralized version control tools

CVS, SVN (Subversion), VSS…….

Centralized version control systems, such as CVS and SVN, have a single centrally managed server that holds revisions of all files, and people who work together connect to this server through clients to retrieve the latest files or submit updates. This has been standard practice for version control systems over the years

There are many benefits to this approach, and everyone can see to some extent what others on the project are doing. Administrators can easily control the rights of each developer, and manage a centralized version control system much more easily than maintaining a local database on each client

There are two sides to a story, good and bad. The obvious downside to this is the single point of failure of the central server. If the server is down for an hour, no one can commit an update and no one can work together during that hour

conclusion

  • Pros: You can see what others are doing; Developer rights control
  • Disadvantages: Single point of failure of central server, unable to commit history

Distributed version control tools

Git, Mercurial, Bazaar, Darcs…….

A distributed version control tool like Git does not take a snapshot of the latest version of the file, but a complete mirror of the code repository (the local library). In this way, the failure of any of the co-working files can be later recovered using the local repository of other clients. Because every file extraction for each client is actually a complete backup of the entire file repository

The emergence of distributed version control systems addresses the shortcomings of centralized version control systems:

  1. It can also be developed when the server is offline (because version control is done locally)
  2. Each client also saves the entire project (including history, which is more secure)

Advantages:

  • Version control is local and can be developed off the network
  • Keep complete projects, including historical records, more secure

1.4 a Brief history of Git

1.5. Git working mechanism

  • The workspaceWrite code, passgit addCommand add toThe staging area
  • The staging areaTemporary storage code, throughgit commitSubmitted toThe local library
  • The local libraryRecord history, passgit pushPush toThe remote repository

1.6. Git and hosting center

A code hosting center is a web server-based remote code repository, commonly referred to simply as a remote repository

  • Local area network (LAN)
    • :ballot_box_with_check: GitLab
  • The Internet
    • : ballot_box_WITH_check: GitHub
    • : Ballot_box_WITH_check: Gitee code Cloud (domestic website)

2. Git installation


It-scm.com/

To view the GNU license, click Next

Select the Git installation location, a non-Chinese directory with no Spaces, and then proceed

Git options are configured, default Settings are recommended, and then next

Git installation directory name, do not change, directly click Next

Git’s default editor. It is recommended to use the default Vim editor and click Next

The default branch name is set to let Git decide. The default branch name is master

Change the Git environment variable, select the first one, do not change the environment variable, only use Git in Git Bash

Select the background client connection protocol, the default OpenSSL, and then the next step

Configure the Git file’s end-of-line newline character, use CRLF for Windows and LF for Linux, select the first automatic conversion, and proceed to the next step

Select the Git terminal type, the default Git Bash terminal, and proceed to the next step

Select the Git pull merge mode, default, and next

Select Git’s credential manager, the default cross-platform credential manager, and next

For other configurations, select default Settings and then next

Lab functions, technology is not mature, there are known bugs, do not check, then click the Install button in the lower right corner, start installing Git

Click Finsh button to install Git successfully!

Right-click anywhere and choose Git Bash Here from the shortcut menu to open the Git Bash command line terminal

Enter Git –version in the Git Bash terminal to check the Git version, as shown in the figure

Git common commands

The command role
Git config user.name Specifies the user name Setting a User Signature
Git config user.email Setting a User Signature
git init Initialize the local library
git status View local library status
Git add file name Add to staging area
Git commit -m "Log info" file name Commit to a local library
git reflog Viewing Historical Records
Git reset -- Hard version number Version of the shuttle

3.1. Set the user signature

1) Basic grammar

Git config --global user.email Git config --global user.emailCopy the code

2) Case practice

Global – wide signature Settings

Description:

The function of the signature is to distinguish the identity of the operator. The user’s signature information can be seen in the submission information of each version to confirm who committed the submission

The first Git installation will not commit code unless you set up a user signature

Note that setting the user’s signature here has nothing to do with how you’ll log into GitHub (or any other code hosting center) in the future

3.2. Initialize the local library

1) Basic grammar

git init
Copy the code

2) Case practice

3.3. View the status of the local library

1) Basic grammar

git status
Copy the code

2) Case practice

Before adding files

After adding files

3.4. Add temporary storage area

1) Basic grammar

Git add file nameCopy the code

2) Case practice

Red indicates that it is still in the workspace and changes have not been traced; Green means added to staging area and changes are tracked

Delete the file from the staging area using the command (just delete the staging area, not affecting the workspace)

git rm --cached hello.txt
Copy the code

3.5. Commit to the local library

1) Basic grammar

# -m indicates to add a version log. This parameter will open the file box for the log. General band parameter
git commit -m "Log Message"The file nameCopy the code

2) Case practice

Normal operation

No -m parameter is available

If you force out

3.6. Modify the file

A case in field

Git maintains files on a per-line basis, so modifying a file is essentially deleting the previous line and adding the modified line

1 insertion(+), 1 deletion(-)

3.7. Historical version

Viewing historical Versions

1) Basic grammar

View the condensed version information
git reflog
# View detailed version information
git log
Copy the code

2) Case practice

Version of the shuttle

1) Basic grammar

Git reset -- Hard version numberCopy the code

2) Case practice

The file validates the current version number

Git switch is actually a moving HEAD pointer, as shown in the figure below

4. Git branch operation

4.1. What are branches

In version control, multiple tasks are pushed at the same time, and for each task, we can create separate branches for each task. Using branches means that the programmer can separate his work from the main line of development, and develop his own branch without affecting the main line. For starters, a branch is simply a copy, and a branch is a single copy (the underlying branch is actually a reference to a pointer).

4.2. Benefits of branching

Simultaneously promote the development of multiple functions in parallel to improve the development efficiency

During the development of each branch, the failure of one branch has no impact on other branches. Delete the failed branch and start again

4.3 Operation of branches

The command role
Git branch Specifies the branch name Create a branch
git branch -v See the branch
git checkoutBranch name Switch branch
git mergeBranch name Merges the specified branch into the current branch

Create branches and view branches

1) Basic grammar

Git branch Branch name Git branch -vCopy the code

2) Case practice

Switch branch

1) Basic grammar

Git Checkout branch nameCopy the code

2) Case practice

Merging branches

1) Basic grammar

Git merge branch nameCopy the code

2) Case practice

The normal merger

Conflict with

The reason for the conflict: When merging branches, the two branches have two completely different sets of changes in the same place in the same file. Git can’t decide for us which one to use. New code content must be artificially determined

Resolve the conflict

Create branch and switch branch diagrams

Master and hot-fix are both Pointers to a specific version of the record. The current branch is actually determined by HEAD. So creating a branch is essentially creating one more pointer

  • HEAD if it points to master, then we’re on the master branch right now
  • If HEAD points to hotfix, then we are now on the Hotfix branch

So the essence of switching branches is to move the HEAD pointer

5. Git team cooperation mechanism

5.1 Teamwork

5.2. Collaborate across teams

6. GitHub operations

  • GitHub website: github.com/

PS: The world’s largest gay dating website, tech nerd paradise, the door to a new world, what are you waiting for?

account The name Validation email
atguiguyuebuqun Yue not the cluster [email protected]
atguigulinghuchong Make fox blunt [email protected]
atguigudongfang1 East don't hurt [email protected]

6.1. Create a remote repository

6.2. Remote warehouse operation

The command role
Git remote add Alias remote address names
git remote -v View all current remote aliases
Git Clone Remote address Clone the contents of the remote repository locally
Git pull Remote address Alias Remote branch name Pull down the latest content of the remote repository for the branch and merge it directly with the current local branch
Git push alias branch Push content from a local branch to a remote repository

Create a remote repository alias

1) Basic grammar

Git remote -v git remote add Alias remote addressCopy the code

2) Case practice

Push local branches to remote repositories

1) Basic grammar

Git push alias branchCopy the code

2) Case practice

The GitHub external network may have a network delay and a long waiting time. This is normal. It may take a few more attempts, but patience. Except of course you have the tools

git push git-demo master
Copy the code

If SSH password-free login has not been performed on the local PC (detailed in the following section), a Connect to GitHub dialog box is displayed after you run the command

Clicking Sign in with Your Browser will automatically open the system’s default browser

If GitHub does not already Authorize Git, click Authorize GitCredentialManager to Authorize Git

Successful authorization is then prompted (if you have authorized Git Credential Manager before)

Successfully pushed the local branch to the remote library

Credential manager

During the above operation, after clicking Authorize GitCredentialManager, Git Credential Manager authorization information can be viewed in the Application option – Authorized OAuth Apps on the GitHub Settings page

Before the above procedure, there is no identity credentials information in the local credential manager (no Git and GitHub credentials information).

After the preceding command is executed, Git credential information is displayed in the local credential manager

Pull remote warehouse to local

1) Basic grammar

Git pull alias branchCopy the code

2) Case practice

Clone the remote repository locally

1) Basic grammar

git cloneRemote library addressCopy the code

2) Case practice

First get the address of the remote library that you want to clone

Since there is already a repository address with the same name under workspace, you will get an error message if you type the command directly into workspace

This is because the clone command creates a remote repository folder with the same name by default, so I removed the git-demo directory

Summary: Clone does the following

  • 1. Pull code
  • 2. Initialize the local repository
  • 3. Create alias (defaultorigin)

6.3. Teamwork

Unable to Access is prompted if a member outside the project wants to push their code to a remote library. 403

In order to obtain the permission to push, the project administrator needs to invite the member to add it to the project

1) Invite the collaborator, enter the user name, copy the address and send to the collaborator

2) Collaborators visit the link and click accept the invitation to see the remote warehouse on their account

  • Github.com/atguiguvuey…

Git commands can be used to clone, pull, commit, and push remote libraries

6.4. Collaborate across teams

1) Collaborator perspective

Click on Fork and “Fork” the other items onto your account

You can clearly see the project forked from XXX, and you can modify the code

After modifying the code, click Pull Requests — New Pull Request to initiate a Pull request

To view the changes, click Create Pull Request to Create a pull request

To fill in the request information and comment content, click Create Pull Request

Has been created

2) Project manager perspective

You can see a new record of Pull Requests in the project, which you can view by clicking Submit information below

If you want to see the details of the modification of the collaborator, you can click Submit Record to view

In the meantime, pull requests can be reviewed and commented on

Finally, Merge pull Request is ready to Merge the pull request

Click Confirm Merge to Confirm the merge

Once the merge is successful, project members can see the changes

6.5 SSH Password-free Login

1) Basic grammar

# -t specifies the encryption algorithm, -c adds commentsSsh-keygen -t Rsa-c descriptionCopy the code

2) Case practice

The SSH key is generated locally

Type the command and press Enter three times

Go to the ~/. SSH directory and copy the public key information

Add a public key to GitHub

If no public key is added, a warning message is displayed indicating that SSH has no permission

In GitHub Settings – SSH and GPG Keys, click New SSH Key to add a public key

Paste the id_rSA. pub public Key information into the Key. Click Add SSH Key to Add the Key

If the following information is displayed, the IP address is successfully added

Verify that SSH secret-free login is available

Enter the git-demo project, open Code – SSH, and find that there is no warning message, indicating that it is available

To copy the SSH address, run the clone command and type yes

Now it’s time to modify content, add staging, commit local libraries, and push remote libraries

At this time, we found that there was no longer a prompt message for login authorization, so we could push it to the past

View the historical version information of the remote database and confirm that the remote database is pushed successfully

SSH password-free login is configured successfully.

7. IDEA integrates Git

7.1. Configure Git ignore files

Question 1: Why ignore them? Answer: It has nothing to do with the actual function of the project and does not participate in the deployment and operation of the server. Ignoring them can mask differences between IDE tools.

Question 2: How to ignore?

1) Create an ignore rule file named xxxx.ignore.

In principle, this file can be stored anywhere, in order to facilitate the ~/. Gitconfig file reference, it is recommended to put in the user’s home directory

Git. ignore file template content

# Compiled class file 
*.class 
 
# Log file 
*.log 
 
# BlueJ files 
*.ctxt 
 
# Mobile Tools for Java (J2ME) 
.mtj.tmp/ 
 
# Package Files # 
*.jar 
*.war 
*.nar 
*.ear 
*.zip 
*.tar.gz 
*.rar 
 
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 
hs_err_pid* 
.classpath 
.project .settings target .idea 
*.iml 	crash logs, see
Copy the code

2) Reference ignore configuration file in.gitconfig file (this file is in Windows home directory)

[core]
	excludesfile = C:/Users/Archimedes/git.ignore
Copy the code

Note: Use forward slash (/) here, do not use backslash (\)

7.2. Locate Git Programs

7.3. Initialize the local Library

Obviously, the file has turned red, which means it’s not being traced. Git has detected the file under git-test, but the file has not been added to the staging area

7.4 add to temporary storage area

After the addition, you can see that the file color turns green, indicating that the file is being traced. Git has added the file to the staging area, but has not committed the local library

Create a com.test.test. Java file under SRC — main — Java

IDEA automatically detects the file and prompts you to add test.java to the staging area

Instead of adding a single file directly, Cancel. Instead, Add on the entire project so that all files under the project can be added to the staging area

You will notice that the test. Java file turns green, indicating that it was successfully added

7.5. Commit to a local library

Click the Commit Diretory… After that, you can see the file in the staging area and enter the log information to commit

Git has committed the file to a local library

7.6. Switch the version

Modify the file first. If the color of the modified file is blue, it indicates that the file has been modified. You can perform the COMMIT operation directly

Click Git at the lower left corner of IDEA to view the historical version

Select a version and click Checkout Reversion XXX

You can see how the HEAD pointer changes with each version shuttle

7.7. Create a Branch and switch branches

Click master — New Branch in the lower right corner of IDEA to create a Branch

Enter the branch name and click Create to Create it

You can also right-click on your project — Git — New Branch, or — Git — Branches — New Branch

The same goes for switching branches, right click or lower right corner

7.8. Merge branches

First switch to the hot-fix branch, modify the content and submit it, then switch back to the Master branch, also select the branch hot-fix we need to Merge in the lower right corner, select Merge Selected into Current, Merge the hot-fix branch to the Master branch

You find that the content has changed, and you see that the historical version has changed

7.9. Merge Conflicts

First, toggle master and hot-fix respectively to modify and commit the test.java content

Master Version information

Hot-fix version information

As you can see, the historical version forks. Now merge hot-fix to master, prompting Conflicts to indicate a merge conflict

Click Merge to manually Merge

For merging code, click Apply to merge the merged code. For merging code, click Apply

You’ll notice that the file color changes to a normal color, and the historical version changes, merging the original two branches into one

8. IDEA integrates with GitHub

8.1. Set a GitHub Account

Set by account password

To open Settings, click Log In via GitHub…

The browser is automatically opened for authorization confirmation

After clicking Authorize in GitHub, the system prompts that the authorization is successful

If an account is added in IDEA, the account is successfully added

Setting by Token

Click Log In with Token…

The Add GitHubh Account box will pop up. Enter the Token information we created on GitHub

If you haven’t already generated or lost the Token you created earlier, you can just click Generate… By default, permissions have been checked

After modification and confirmation, click Generate Token to Generate

After the Token is generated, it is displayed only once on the current page. You need to copy and save the Token in time

Paste the Token into the input box and click Add Account to Add it

Finally, be sure to hit Apply and OK to save your Settings

8.2. Share projects on GitHub

We usually create a Repository in the remote Repository, then associate the local Repository with the remote Repository via remote, and finally push the version

Alternatively, create a Repository in the remote Repository, clone the remote Repository to the local Repository, and push the version

In IDEA, the above steps can be combined into one step, that is, sharing the local library to GitHub through Share, which is very convenient

After filling in the information, click the Share button, IDEA will automatically help us create and initialize the remote library, and push the local library to the remote library

Check to see if the repository exists on GitHub to verify that the sharing is successful

During the sharing process, the following error may occur: The remote repository was successfully created, but the initialization push failed. This is where you need to do a manual Push

8.3. Push a local branch to a remote library

By default, HTTPS is used for push. Due to network problems, push may fail

To change the remote connection mode, click Define Remote to set a new remote alias

Then a new interface will pop up to redefine the remote mode, using the SSH protocol remote address (note: do not duplicate the original alias).

After clicking OK, you can re-select the remote alias, in this case the alias for the SSH protocol we just defined: Origin-ssh

View the historical version changes on GitHub and push them successfully

Note: Push pushes local library code to remote library. If the local library code version does not match the remote library code version, the push operation will be rejected. In other words, in order for the push to succeed, make sure that the version of the local library is higher than the version of the remote library! Therefore, a mature programmer must check the differences between remote libraries and native code before making changes to it! If the local version of the code is already behind, remember to pull the remote library code, update the local code to the latest, and then modify, submit, push!

8.4. Pull a remote library to a local directory

First modify the remote library code, and then do the following

Select the SSH protocol alias and click Pull to Pull the code

Check the local library code is easy to change, and the historical version also has relevant records, indicating that the code pulled successfully

8.5. Clone Clone the remote database to the local PC

Close the project, on the IDEA selection page, click Get From VCS

Enter the address of the remote warehouse and the address of the local warehouse, and click Clone

Waiting for the clone to complete

When you enter the Project for the first time, you will be prompted whether to Trust and open the Maven Project

If you check Trust Projects in XXX, all new projects under this workspace will be trusted and will not be prompted

Open the project and verify that the test. Java content is correct and the historical version record is normal

Domestic code hosting center **-** code cloud

As we all know, GitHub server is in foreign countries, and GitHub is used as the project hosting website. If the Internet speed is not good, the user experience will be seriously affected, and even the login will not be possible. In view of this situation, we can also use the domestic project hosting website – code cloud

Code cloud is a Git-based code hosting service launched by Open Source China. The website is gitee.com/, which is used in the same way as GitHub. It is also a Chinese website, and it is the best choice if your English is not very good

9.1. Create a remote library

If you enter the warehouse name, the path is automatically the same as the warehouse name. Select Open Source and click Create

After creation, it will automatically jump to the project interface. Copy the following address for backup

9.2. Delete the remote library

Open Project Management – Warehouse Settings – Delete Warehouse and click Delete Warehouse

Enter the confirmation information and click Ok to delete

Enter the password, confirm it again, and click Verify to delete it successfully

9.3 IDEA Integrated code cloud

First, install the Gitee plug-in

After the installation is complete, clicking Apply refreshes the Settings option and opens Version Control with a Gitee option

You can log in using a password or a Token. The operation is the same as that of integrating GitHub with IDEA

After entering your account password, click Log In

If the input is correct, the account information will be displayed in the interface, click OK to save

9.4. Share projects to Gitee

If a project with the same name already exists in the remote repository, the system will prompt you to delete the git-test repository you just created

Prompt Sharing succeeded

Check Gitee to confirm that the repository has been created and pushed successfully

9.5. Push local branches to remote libraries

To modify the content, click Commit in the left navigation bar to Commit and push the content

You can also customize remote address aliases by clicking Push

View the historical version records of the Gitee warehouse to confirm that the push is successful

9.6. Pull a remote library to a local directory

After modifying the test. Java content directly on Gitee, Pull the IDEA

Select the alias and branch we specify and click Pull to Pull

Test. Java is pulled successfully if the historical version changes

9.7. Clone a remote library to a local computer

9.8 Code cloud replication GitHub project

Import warehouse

Click import repository from GitHub/GitLab

Input GitHub warehouse address, Gitee will automatically fill in the warehouse name and path information for us, modify it to open source or private, and click Import

Wait a moment

Import success

Mandatory synchronization

If the project is modified on GitHub, you can click the refresh icon to forcibly synchronize the project

Note that the forced update overwrites the current repository, click OK here

View historical version records to confirm the synchronization

10. Self-built code hosting platform — GitLab

10.1 Introduction to GitLab

GitLab is an MIT licensed web-based Git repository management tool developed by GitLabInc., with wiki and issue tracking features. Using Git as a code management tool, and built on the basis of web services

GitLab was developed by Ukrainian programmers DmitriyZaporozhets and ValerySizov and is written in Ruby. Later, some parts were rewritten in Go. As of May 2018, the company has approximately 290 team members and more than 2,000 open source contributors. GitLab is used by IBM, Sony, JulichResearchCenter, NASA, Alibaba, Invincea, O ‘reilly media, leibniz-rechenzentrum (LRZ), CERN, SpaceX and other organizations

10.2 GitLab official website address

  • Official website: about.gitlab.com/
  • Installation instructions: about.gitlab.com/installatio…

10.3 GitLab installation

Preparing the server

A server running CentOS7 or later has the following requirements: 4 gb memory and 50 gb hard disk

Disable the firewall and configure the host name and IP address to ensure that the server can access the Internet

This tutorial uses virtual machine: host name: gitlab-server IP address: 192.168.6.200

Preparing installation packages

When installing Gitlab-CE online, you need to download hundreds of MB of installation files, which is very time-consuming. Therefore, it is best to download the required RPM packages to the local PC in advance and use the offline RPM mode to install gitlab-CE

Download address:

  • packages.gitlab.com/gitlab

Note: The RPM package is provided in the documentation. You can directly upload the package to the /opt/module directory of the server

Writing installation Scripts

The procedure of installing GitLab is quite tedious, so we can refer to the official website to write the installation script of GitLab

vim gitlab-install.sh
Copy the code

Copy the following script contents to the created gitlab-install.sh file

Sudo RPM -ivh /opt/module/ gitlab-ce-13.10.2-ce-0.el7.x86_64. RPM sudo yum install -y curl policycoreutils-python openssh-server cronie sudo lokkit -s http -s ssh sudo yum install -y postfix sudo service postfix start sudo chkconfig postfix on curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash sudo EXTERNAL_URL="http://gitlab.example.com" yum -y install gitlab-ce
Copy the code

Add execution permission to a script

chmod +x gitlab-install.sh
Copy the code

If the script is green, you have the execution permission

Then execute the script to start installing Gitlab-CE. Make sure that the server has Internet access

./gitlab-install.sh
Copy the code

Be patient for a while

Script Execution succeeded

Initialize the GitLab service

Execute the following command to initialize the GitLab service

gitlab-ctl reconfigure
Copy the code

This should take a few minutes. Be patient…

Appear gitlab Reconfigured! The GitLab service is successfully initialized

Start the GitLab service

Run the following command to start the GitLab service

gitlab-ctl start
Copy the code

If you need to stop it, run the command

gitlab-ctl stop
Copy the code

Service started successfully

Use a browser to access GitLab

To access the GitLab service, use a host name or IP address. To use a host name to access the GitLab service, configure the Windows hosts file in advance

Before logging in for the first time, you need to change the password of root account provided by GitLab. The password must be more than 8 characters, including upper and lower case children and special symbols. Therefore, we change the password to atguigu. 123456 and log in to GitLab with the changed password

Next, you can log in with the account password you just changed

Login successful

GitLab creates remote libraries

Here I take the official website GitLab as an example, the official website address: gitlab.com/

The official website also provides GitLab’s own project source: gitlab.com/gitlab-org/…

Click New Project/Repository — Create a Project to Create the GitLab repository

After filling in the project information, click Create Project

Creating a successful

The IDEA of integrated GitLab

1) Install the GitLab plugin

2) Set up the GitLab plugin

If the related information is displayed, the vm is added successfully

3) Push local code to GitLab remote library

Let’s start by adding a remote library alias

Click on the Git – Manage Remotes

Click the + sign to customize a remote alias and the corresponding remote library address, and click OK

If the previous record appears, the remote alias was added successfully. Click OK

As long as the GitLab remote library connection is defined, the pull and clone operations on the GitLab remote library are consistent with Github and code cloud, which will not be described here