Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

git-track

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:

rm -rf .git 

from my projects directory or is there a way to do this as a Git command?

I used this project to learn Git and realize I made some mistakes early on in the project with moved, renamed and deleted files. I'd like to remove all Git tracking and start fresh with git init.

like image 986
daustin777 Avatar asked Jan 21 '11 00:01

daustin777


People also ask

Is git clone tracked?

git clone A Branch git clone --single-branch : By default, git clone will create remote tracking branches for all of the branches currently present in the remote which is being cloned. The only local branch that is created is the default branch.

How do I remove a clone in git?

In some cases, you don't want to delete a remote GitHub repository but you only want to delete the copy you got by cloning the remote repository. In order to delete a local GitHub repository, use the “rm -rf” on the “. git” file located at the root of your Git repository.


1 Answers

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.

like image 52
bobDevil Avatar answered Oct 08 '22 05:10

bobDevil