如何退出 git:(master) ✗?

How to exit from git:(master) ✗?

如何从 mac 终端退出 "git:(master) ✗"。我有最新版本的 zshgit,安装了默认主题 "robbyrussell"。我尝试了多种方法,$ cd .$ cd ~$ git rm .git,但没有任何帮助。你们中的任何人都可以帮我解决它吗?下面是我在 运行 $ git rm .git

时看到的输出

输出:

➜  ~ git:(master) ✗ git rm .git
fatal: pathspec '.git' did not match any files

➜  ~ git:(master) ✗

我会尝试根据我从你的问题中暗示的内容来回答。

您没有退出 git。终端告诉您的是,您位于分支 master 上的 git 存储库中。 您创建了存储库:通过克隆、复制和粘贴或通过 git init。如果您 cd ..,除非父文件夹也是存储库,否则您应该不会再看到 git 通知。恭喜你,你 "exited" git!

如何取消 git 版本库的版本控制?只需删除其中的 .git 文件夹即可。这样它将不再是 git 存储库。

以下步骤有效;

➜ ~ git:(大师) ✗ pwd

/Users/bunty_home

➜ ~ git:(master) ✗ cd .. (这​​个命令是退出git仓库)

➜ ~ git:(大师) ✗ rm -r .git

为 .git/objects/pack/pack-f76e6a02ba4d161b1b453179ba12835649ce2ace.pack?

覆盖 r--r--r-- bunty_home/staff

按了几次 Enter 同意以上所有问题

➜ ~

➜ ~ pwd

/Users/bunty_home