Linux 如何删除我的存储库的所有 Git 痕迹?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6473374/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I remove all traces of Git for my repository?
提问by TIMEX
I have a repository. ("git init")
我有一个存储库。(“git 初始化”)
I've done check-ins and commits and logs and stuff. But, how can I remove all traces of git and delete git off this directory (and subdirectories)?
我已经完成了签入和提交以及日志和其他东西。但是,如何删除 git 的所有痕迹并将 git 从此目录(和子目录)中删除?
I'm on Ubuntu.
我在 Ubuntu 上。
采纳答案by Daniel DiPaolo
Simply remove the .git
directories inside and you're done.
只需删除.git
里面的目录,你就完成了。
回答by stevekrzysiak
This worked for me:
这对我有用:
find . -name .git -print0 | xargs -0 rm -rf
回答by Robbie Bardijn
I would wildcard that .git
我会通配那个 .git
find . -name "*.git*" -print0 | xargs -0 rm -rf;
回答by Enki
This works well too.
这也很好用。
find . | grep .git | xargs rm -rf