Table of Contents
git remote
vscode
gitkraken
Home Development Tools git A brief analysis of how to clone a project locally on gitlab

A brief analysis of how to clone a project locally on gitlab

Mar 27, 2023 pm 08:07 PM
github gitlab

How to clone the project locally on gitlab? The following article will introduce to you two correct postures for cloning projects from gitlab and commonly used git visualization tools. I hope it will be helpful to you!

A brief analysis of how to clone a project locally on gitlab

We have created a project in the previous lesson. In this lesson, I will clone the project locally and then practice common git commands

There are two ways to git clone

clone, one is SSH, the other is HTTPS, The main difference between the two cloning methods is:

  • HTTPS only needs to copy the link, and then enter the clone command in git Bash to clone the project locally, but you need to enter the account every time you fetch and push the code and password; when using SSH, by default you do not need to enter the account password for each communication, but you need to configure and add the SSH key before cloning. The prerequisite for adding the SSH key is that you must be the owner of this project.

You can choose to download this code repository directly. After downloading, it will be a compressed package and will not carry the .git file.

Now let’s clone our project first

Use the following command to directlyclone,

git clone git@gitlab.com:fe-test1/git-demo.git
Copy after login

The first time you clone You enter your username and password. If you don’t know what your password is, you can modify it in Edit profiles->password. The picture below shows the success of clone.

Now let’s submit a message to test whether ours can be pushed to the remote warehouse.

Open the project and go to README.mdJust modify some information in the file, and then execute

# 添加代码到暂存区域 .添加所有文件
git add . 
# 提交commit信息 "feat" commit规范,后面章节会介绍
git commit -m "feat: 第一次提交代码"
Copy after login

Use git status to check if there is any uncommitted code, prompting us that it is time to push

Execute git push Push the code to the remote

shows that the push is successful and the code is pushed to the main branch . Then let's go to the panel to see if it's the content we just submitted:

You can see the information we just modified and the commit information we submitted.

OK, reaching this point means that you have taken the first step in the company. I have heard many times that some self-proclaimed master programmers are questioned because they cannot even handle this thing, because many new programmers really don’t know how to do this! ! !

git remote

If we create a project locally, how do we establish a connection with the remote repository? The answer is to use git remote

Similarly, first you have to create a remote warehouse local-test, and then create a folder locally local- test, then add a READMD.md file and add some information casually.

Execute the following command in the root directory of the folder:

# 初始化仓库
git init
# 添加暂存区
git add .
# 提交
git commit -m "feat: 建立与远程仓库的连接"
# 添加远程源信息
git remote add origin git@gitlab.com:fe-test1/local-test.git
# push代码到origin/main分支
git push -u origin main
Copy after login

It is considered successful if the code can be successfully pushed to the remote warehouse.

Summary: Generally, if there is an existing code warehouse, we tend to use the first method more. If we are creating a new warehouse and new project, we will use the second method.

vscode

vscode comes with its own git management tool. When we modify something, we can clearly see which files and contents have been modified,

#There are many operation shortcuts on the left side, including temporary storage, submission, push and other operations.

After installing the gitlens plug-in, you can view other people's submission records, especially when merging conflicts, it is more convenient and faster.

gitkraken

Highly recommend this tool, you can easily create a remote warehouse on this tool, or clone the remote warehouse. Manage local repositories and more. Students who cannot access the Internet may not push the code for a long time. With this tool, you don’t need to worry about network problems at all. You can pull and push large files very quickly.

However, it can only be used on mac?

Download address: www.gitkraken.com/

A brief analysis of how to clone a project locally on gitlab

(Learning video sharing: Basic Programming Video )

The above is the detailed content of A brief analysis of how to clone a project locally on gitlab. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to install GitHub Copilot on Windows 11/10 How to install GitHub Copilot on Windows 11/10 Oct 21, 2023 pm 11:13 PM

GitHubCopilot is the next level for coders, with an AI-based model that successfully predicts and autocompletes your code. However, you might be wondering how to get this AI genius on your device so that your coding becomes even easier! However, using GitHub isn't exactly easy, and the initial setup process is a tricky one. Therefore, we created this step-by-step tutorial on how to install and implement GitHub Copilot in VSCode on Windows 11, 10. How to install GitHubCopilot on Windows There are several steps to this process. So, follow the steps below now. Step 1 – You must have the latest version of Visual Studio installed on your computer

How to use GitLab for project document management How to use GitLab for project document management Oct 20, 2023 am 10:40 AM

How to use GitLab for project document management 1. Background introduction In the software development process, project documents are very important information. They can not only help the development team understand the needs and design of the project, but also provide reference to the testing team and customers. In order to facilitate version control and team collaboration of project documents, we can use GitLab for project document management. GitLab is a version control system based on Git. In addition to supporting code management, it can also manage project documents. 2. GitLab environment setup First, I

Centos offline installation of Chinese version of GitLab Centos offline installation of Chinese version of GitLab Feb 19, 2024 am 11:36 AM

1. Download the gitlab installation package. Download the latest Chinese version of the gitlab installation package from [Tsinghua University Open Source Software Mirror Station]. The installation package comes with a simplified Chinese localization package. Download the latest gitlab installation package from [gitlab official website]. 2. Install gitlab, take gitlab-ce-14.9.4-ce.0.el7.x86_64 as an example, upload it to the centos server and use yum to install gitlabyum-yinstallgitlab-ce-14.3.2-ce.0.el7.x86_64. rpm uses yum to install gityum-yinstallgit#Install git and modify the gitlab configuration file vi

Git installation process on Ubuntu Git installation process on Ubuntu Mar 20, 2024 pm 04:51 PM

Git is a fast, reliable, and adaptable distributed version control system. It is designed to support distributed, non-linear workflows, making it ideal for software development teams of all sizes. Each Git working directory is an independent repository with a complete history of all changes and the ability to track versions even without network access or a central server. GitHub is a Git repository hosted on the cloud that provides all the features of distributed revision control. GitHub is a Git repository hosted on the cloud. Unlike Git which is a CLI tool, GitHub has a web-based graphical user interface. It is used for version control, which involves collaborating with other developers and tracking changes to scripts and

How to set access permissions and user roles in GitLab How to set access permissions and user roles in GitLab Oct 20, 2023 am 11:57 AM

How to set access permissions and user roles in GitLab GitLab is a powerful open source code hosting platform that not only helps teams easily manage and collaborate on code development, but also provides flexible access permissions and user role settings. In this article, we'll explore how to set access permissions and user roles in GitLab, and provide specific code examples for reference. 1. Set user roles In GitLab, user roles are mainly divided into Owner, Maintainer, and Develo

GitLab's code base backup and recovery functions and implementation steps GitLab's code base backup and recovery functions and implementation steps Oct 20, 2023 pm 12:04 PM

GitLab is an open source code hosting platform that provides rich features, including code base backup and recovery. Code base backup is one of the important steps to ensure the security of the code and it can help us recover the data when unexpected things happen. This article will introduce GitLab's code base backup and recovery functions, and provide corresponding implementation steps and code examples. GitLab's code base backup function GitLab provides two types of backup: incremental backup and full backup. Incremental backup: Incremental backup means backing up only the latest changed data

GitLab permission management and single sign-on integration tips GitLab permission management and single sign-on integration tips Oct 21, 2023 am 11:15 AM

GitLab's permission management and single sign-on integration tips require specific code examples Overview: In GitLab, permission management and single sign-on (SSO) are very important functions. Permission management can control users' access to code repositories, projects, and other resources, while single sign-on integration can provide a more convenient user authentication and authorization method. This article will introduce how to perform permission management and single sign-on integration in GitLab. 1. Permission Management Project Access Permission Control In GitLab, projects can be set to private

GitHub's latest AI tool helps users automatically fix bugs and vulnerabilities in their code GitHub's latest AI tool helps users automatically fix bugs and vulnerabilities in their code Mar 21, 2024 pm 04:01 PM

Today, GitHub launched a new "Code Scan" feature (preview) for all AdvancedSecurity (GHAS) licensed users, designed to help users find potential security vulnerabilities and coding errors in GitHub code. This new feature leverages Copilot and CodeQL to detect potential vulnerabilities or errors in your code, classify them and prioritize fixes. It's important to note that "code scanning" will consume GitHubActions minutes. According to the introduction, "code scanning" can not only prevent developers from introducing new problems, but can also trigger scans based on specific dates and times, or when specific events (such as pushes) occur in the repository. If AI finds you

See all articles