Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to add catalogs to git

Shulou Source: shulou.com Published: 2022-06-01 03:08:03 09月30日 Update

This article will explain in detail how to add catalogs to git. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

In git, you can add directories using the add command, which adds specified files or directories to the temporary storage area with the syntax "git add folder /"; after adding directories, you can use the "git status" command to view the results of the addition.

This article operating environment: Windows10 system, Git2.30.0 version, Dell G3 computer.

How to add catalogs to git

Git add folder / add entire folder and contents

Git add *. File type add all files of this file type in the directory

The git add command adds the file to the staging area.

Add one or more files to the staging area:

Git add [file1] [file2]...

Add the specified directory to the staging area, including subdirectories:

Git add [dir]

Add all files in the current directory to the staging area:

Git add.

For the following example, we add two files:

The git status command is used to view the current status of the project.

Next, we execute the git add command to add the file:

$git add README hello.php

Now that we execute git status, we can see that these two files have been added.

This is the end of the article on "how to add catalogs in 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.

Tags: Files directories commands storage areas folders articles two content more types good practical next functions multiple subcategories subdirectories examples that is articles Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Huawei MariaDB NVidia Microsoft