Home  >  Article  >  Development Tools  >  How to delete files in Git

How to delete files in Git

藏色散人
藏色散人Original
2018-11-16 17:02:0727199browse

This article mainly introduces How to delete files in Git.

GIT stands for distributed version control system. Regarding the specific introduction and basic operations of Git, we have already explained it to you in previous articles.

Friends who need it can refer to these articles first: What is Git, Initial use of Git and How to create a version library with Git , Git temporary storage area.

Now we will continue to introduce to you How to delete files in Git.

Git deletes filesThere are two methods:

The first: manually delete a file in the specified folder File (i.e. right-click the file and click Delete).

After manually deleting the file, we still need to open the Git command line, add the record of the deleted file to the staging area, and then submit it to the repository.

The specific command operations are as follows:

How to delete files in Git

Second: Delete directly through the Git command line

The specific operation is as shown below. First add the file to the staging area through git add, and then submit it to our repository. Then use the git rm index.txt command to delete the index.txt file, and then check the status to show that the deleted file is index.php.

How to delete files in Git

The files in the workspace have been deleted at this time.

This article is a detailed introduction to Git deleting files. It is also very simple and easy to understand. I hope it will be helpful to friends in need!

The above is the detailed content of How to delete files in Git. For more information, please follow other related articles on the PHP Chinese website!

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