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

Example Analysis of Command Line in basic Operation of GIT Local Library

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the GIT local library basic operation of the command line example analysis, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.

Basic principles of GIT Local Library Operation

As a distributed version library software, GIT is a version library on each machine.

After git initialization, there are three areas, namely, the workspace, the staging area, and the local library

The workspace is the difference between editing the code, including adding, modifying, and deleting the code. After we edit the code, add it to the temporary storage area.

A temporary storage area is a place where code is temporarily stored to facilitate batch submission of data to the local library.

The local library is where the final historical version of the file is stored

Git config sets global users

When doing some local version library operations, you need to know who you are, so we need to set up the global user first.

Right-click Git Bash here

Execute:

Git config-global user.name "java1234"

Git config-global user.email "java1234@qq.com"

Git init initialization version library

Preparatory work

We create a new gitworkspace on disk E as the git workspace

Then right-click Git Bash here

Execute git init

This adds a .git directory to the current directory.

open

Here are some configuration files and control programs managed by the version library, as well as storage directories

After initializing the version of init, any operation of all files in this directory can be tracked by git, and then the version library can be managed.

Git status to view operation status

Git status to view operation status

If there are actions to add and submit, you will be prompted

Git add added to staging area

Git add files add new or modified files to the temporary zone

Let's create a new a.txt in the workspace and write three lines of text in it.

We git status to check the operation status:

There is one to add.

Git add a.txt execution

You can add new files to the temporary storage area.

Git commit submitted to the version library

Git commit-m "remarks" is mainly to submit one or more files to be submitted in the temporary storage area to the local version library.

Thank you for reading this article carefully. I hope the article "Command Line sample Analysis in the basic Operation of GIT Local Library" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

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: 0

*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

Internet Technology

Wechat

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

12
Report