Home  >  Article  >  Development Tools  >  How to delete the git repository in the project

How to delete the git repository in the project

WBOY
WBOYOriginal
2022-06-30 16:29:4712745browse

How to delete the git repository in the project: 1. Click "View" in the folder and check "Hide Project" to view the hidden project git folder; 2. In this folder, Use the "find . -name ".git" | xargs rm -Rf" command to delete the git repository.

How to delete the git repository in the project

The operating environment of this article: Windows 10 system, Git version 2.30.0, Dell G3 computer.

How to delete the git repository in the project

1. git local repository

The fundamental principle of deleting the Git local repository is to delete the "Git local repository" The hidden folder ".git" under the root directory
Click "View" in the folder, and then check "Hidden Project" to view the hidden project git folder
How to delete the git repository in the project

2. Use the command line to delete the git local warehouse

In this folder, right-click to open git bash here and enter the command

find . -name ".git" | xargs rm -Rf

Then press Enter

3. Delete successfully

  1. There is no git hidden folder in the current folder
  2. git bash There is no master in the command line here.

    How to delete the git repository in the project

##Extended knowledge:

To delete a warehouse, you need to delete the .git folder hidden under the warehouse folder! ! !

Enter the directory where the project is located, open git bash, and start deleting the local warehouse:

显示所有本地分支(初始化时只有一个master分支)
$ git branch
初始化本地版本库(重新初始化一次,可以忽略)
$ git init
找到目录下隐藏的 .git
$ ls -a
删除 .git
$ rm -rf .git

Recommended learning: "

Git Tutorial"

The above is the detailed content of How to delete the git repository in the project. 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