Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the function of git?

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail what the role of git is for you. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

Git

Git is a distributed modern version control system, which realizes a kind of fast version control. It's very lightweight and extremely fast. At the same time, Git is easy to use for any type of knowledge worker.

Basic process of Git

The basic Git workflow is as follows:

Modify the file in the working directory.

Temporarily save the file and put a snapshot of the file in the temporary storage area.

Submit the update, find the file in the staging area, and permanently store the snapshot in the Git warehouse directory.

Schematic diagram of Git

If you want to learn more smoothly, remember the following concepts about Git. Git has three states, and your file may be in one of them: submitted (committed), modified (modified), and temporarily saved (staged). Submitted indicates that the data has been safely saved in the local database. Modified means that the file has been modified, but it has not been saved to the database. A temporary save indicates that the current version of a modified file is marked to be included in the next submitted snapshot.

This introduces the concept of three work areas of the Git project: the Git repository, the working directory and the temporary storage area.

Git warehouse

The code repository is the place where Git stores project metadata and object databases. This is the most important part of Git, where data is copied when cloning repositories from other computers.

Working directory

The working directory is the content extracted independently from a version of the project. These files extracted from the compressed database of the Git warehouse are put on disk for you to use or modify.

Temporary storage area

The staging area is a file that holds the list of files that will be submitted next time, usually in the Git repository directory. It is sometimes called an "index", but it is generally called a temporary storage area.

Remote warehouse

To be able to collaborate on any Git project, you need to know how to manage your own remote repository. A remote repository is a repository of versions of your project hosted on the Internet or other networks. You can have several remote warehouses, some of which are read-only to you and some that can read and write to you. Collaborating with others involves managing remote warehouses and pushing or pulling data as needed. Managing remote repositories includes understanding how to add remote repositories, removing invalid remote repositories, managing different remote branches and defining whether they are tracked, and so on.

Branch

Almost all version control systems support branching in some form. Using branches means that you can separate your work from the development mainline so as not to affect the development mainline.

Experimental part Chapter1: new code base Step 1: enter iCode

Click the "enter iCode" button from the home page of the project.

Step 2: click the "New Code Base" button

Step 3: enter a code base name

Code library name: JavaDemo

Step 4: set the code base type

We select "Private" here, fill in the code base introduction and click OK to complete the code base creation.

Step 5: click the OK button to complete the creation and enter the code base Step 6: set the HTTP password

Note: when using Git to connect to the iCode code base, if you need to enter a password, please use the password set in this step!

Click the account settings

Enter password

Enter the password again

Click the send CAPTCHA button

Check the SMS messages and enter the received CAPTCHA here

Click the Save password button

Chapter2: add members and assign permissions Step 1: enter the member settings interface

Step 2: assign readable permissions to sub-user icode

Click the "readable permissions" page to sign

Select the member type

Select sub-user "icode"

Click the add button

Chapter3: install GitStep locally 1: check if Git is already installed

Execute the command git-- version

Check to see if the current version information is output, and if Git is currently installed, go directly to Step 3.

Step 2: download and install Git

If you do not currently have Git installed, visit the Git official website download link in your browser: https://git-scm.com/downloads

Click the download button to download the installation package and complete the installation

If the download has not started, you can click the manual download link

Step 3: check again whether the Git version has been installed Chapter4: import the sample code into the code base Step 1: download the code base

Create a development directory and execute the command mkdir icode_starter & & cd icode_starter

Download the sample code locally and execute the command git clone https://gitee.com/devopssa_devopssa/javademo.git

Step 2: import the downloaded sample code into the icode code repository

Go to the home page of the code warehouse and copy the scenario 2 script

Change the first script to cd gs-spring-boot/, as follows:

: execute script

Refresh the code repository page to see if the code has been successfully imported

? Congratulations, you have completed the preparation of the code base!

Sign-in screenshot

For students who have completed the operation in scenario 2, please upload a screenshot of the code base you created, and require the code base to contain the real code:

Example:

This is the end of this article on "what is the role of git". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 281

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report