How do I remove version tracking from a project cloned from git?

后端 未结 10 1346
太阳男子
太阳男子 2020-11-28 00:00

I want to remove all version tracking from a project\'s directory.

What is the correct method to do this?

Can I do a shell command such as:

r         


        
10条回答
  •  臣服心动
    2020-11-28 00:31

    It's not a clever choice to move all .git* by hand, particularly when these .git files are hidden in sub-folders just like my condition: when I installed Skeleton Zend 2 by composer+git, there are quite a number of .git files created in folders and sub-folders.

    I tried rm -rf .git on my GitHub shell, but the shell can not recognize the parameter -rf of Remove-Item.

    www.montanaflynn.me introduces the following shell command to remove all .git files one time, recursively! It's really working!

    find . | grep "\.git/" | xargs rm -rf
    

提交回复
热议问题