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
All the data Git uses for information is stored in .git/
, so removing it should work just fine. Of course, make sure that your working copy is in the exact state that you want it, because everything else will be lost. .git
folder is hidden so make sure you turn on the Show hidden files, folders and disks
option.
From there, you can run git init
to create a fresh repository.
Windows Command Prompt (cmd) User:
You could delete '.git' recursively inside the source project folder using a single line command.
FOR /F "tokens=*" %G IN ('DIR /B /AD /S *.git*') DO RMDIR /S /Q "%G"
You can also remove all the git related stuff using one command. The .gitignore file will also be deleted with this one.
rm -rf .git*
In a Windows environment you can remove Git tracking from a project's directory by simply typing the below.
rd .git /S/Q