I created a git repository with git init
. I'd like to delete it entirely and init a new one.
Git – How to fully delete a git repository created with init
gitgit-init
Related Topic
- Git: How to force “git pull” to overwrite local files
- Git – Move the most recent commit(s) to a new branch with Git
- Git – How to check out a remote Git branch
- Git – How to delete a Git branch locally and remotely
- Git – How to change the URI (URL) for a remote Git repository
- Git – How to push a new local branch to a remote Git repository and track it too
- Git – How to revert a Git repository to a previous commit
- Git – How to rename a local Git branch
Best Answer
Git keeps all of its files in the
.git
directory. Just remove that one and init again.If you can't find it, it's because it is hidden.
In Windows 7, you need to go to your folder, click on Organize on the top left, then click on Folder and search options, then click on the View tab and click on the Show hidden files, folders and drives radio button.
On a Mac OS:
Open a Terminal (via Spotlight: press CMD + SPACE, type
terminal
and press Enter) and run:Note: The keyboard shortcut to show hidden files in Finder is CMD + SHIFT + . so it is no longer necessary to modify the finder config this way
You could also type
cd
(the space is important), drag and drop your git repo folder from Finder to the terminal window, press return, then typerm -fr .git
, then return again.On Ubuntu, use shortcut Ctrl + H.