Home > Article > Development Tools > How to delete files in Git
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:
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.
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!