如何删除我的存储库的所有Git痕迹? [重复]

时间:2022-04-08 07:34:02

This question already has an answer here:

这个问题在这里已有答案:

I have a repository. ("git init")

我有一个存储库。 (“git init”)

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上。

4 个解决方案

#1


6  

Simply remove the .git directories inside and you're done.

只需删除里面的.git目录就可以了。

#2


15  

This worked for me:

这对我有用:

find . -name .git -print0 | xargs -0 rm -rf

#3


4  

I would wildcard that .git

我会通配那个.git

find . -name "*.git*" -print0 | xargs -0 rm -rf;

#4


-1  

This works well too.

这也很有效。

find . | grep .git | xargs rm -rf

#1


6  

Simply remove the .git directories inside and you're done.

只需删除里面的.git目录就可以了。

#2


15  

This worked for me:

这对我有用:

find . -name .git -print0 | xargs -0 rm -rf

#3


4  

I would wildcard that .git

我会通配那个.git

find . -name "*.git*" -print0 | xargs -0 rm -rf;

#4


-1  

This works well too.

这也很有效。

find . | grep .git | xargs rm -rf