如何完全删除用init创建的git仓库? [英] How to fully delete a git repository created with init?
问题描述
我使用 git init
创建了一个git仓库。我希望完全删除它并初始化一个新的文件。
.git
目录。 如果找不到它,那是因为它被隐藏了。
-
在Windows 7中,您需要转到您的文件夹,单击左上角的组织,然后单击文件夹和搜索选项,然后点击查看标签并点击显示隐藏文件,文件夹和驱动器单选按钮。
-
打开终端(通过Spotlight:按 CMD + SPACE ,键入
终端
并按 Enter )并执行以下命令:defaults write com.apple.finder AppleShowAllFiles 1&& killall Finder
。 -
或者您也可以键入
cd
),将你的git repo文件夹从Finder拖放到终端窗口,按 return ,然后键入rm -fr .git
,然后在Ubuntu上,使用快捷键 Ctrl + Ctrl + Alt + Enter。 H 。 In Windows 7, you need to go to your folder, click on Organize on the top left, then click on Folder and search options, then click on the View tab and click on the Show hidden files, folders and drives radio button.
On a Mac OS:
Open a Terminal (via Spotlight: press CMD + SPACE, type
terminal
and press Enter) and do this command:defaults write com.apple.finder AppleShowAllFiles 1 && killall Finder
.Or you could also type
cd
(the space is important), drag and drop your git repo folder from Finder to the terminal window, press return, then typerm -fr .git
, then return again.
On Ubuntu, use shortcut Ctrl + H.
在Mac OS上:
I created a git repository with git init
. I'd like to delete it entirely and init a new one.
Git keeps all of its files in the .git
directory. Just remove that one and init again.
If you can't find it, it's because it is hidden.
这篇关于如何完全删除用init创建的git仓库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!