如何完全删除用init创建的git仓库? [英] How to fully delete a git repository created with init?

查看:136
本文介绍了如何完全删除用init创建的git仓库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 git init 创建了一个git仓库。我希望完全删除它并初始化一个新的文件。

Git将其所有文件保存在 .git 目录。

如果找不到它,那是因为它被隐藏了。




  • 在Windows 7中,您需要转到您的文件夹,单击左上角的组织,然后单击文件夹和搜索选项,然后点击查看标签并点击显示隐藏文件,文件夹和驱动器单选按钮。


  • 在Mac OS上:




    • 打开终端(通过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 。



    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.

    • 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 type rm -fr .git, then return again.

    • On Ubuntu, use shortcut Ctrl + H.

    这篇关于如何完全删除用init创建的git仓库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆