I created a git repository with git init
. I\'d like to delete it entirely and init a new one.
In windows:
Now you can delete .git folder
after cloning the repo
cd /repo folder/
to go to the file directory then
ls -a
to see all files hidden and unhidden
.git .. .gitignore .etc
if you like you can check the repo origin
git remote -v
now delete .git which contains everything about git
rm -rf .git
after deleting, you would discover that there is no git linked check remote again
git remote -v
now you can initial your with
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/Leonuch/flex.git
git push -u origin master
To fully delete the .git
repository in your computer (in Windows 8 and above):
.git
repository is normally hidden in windows .git
repository then you can delete ittrue,like mine was stored in USERS,so had to open USERS go to View on you upper left find Options,open it and edit folders'view options in view still to display hidden files/folders,all your folders will be displayed and you can deleted the repo manually,remember to hide the files/folders once done with the delete.
Windows cmd prompt: (You could try the below command directly in windows cmd if you are not comfortable with grep, rm -rf, find, xargs etc., commands in git bash )
Delete .git recursively inside the project folder by the following command in cmd:
FOR /F "tokens=*" %G IN ('DIR /B /AD /S .git') DO RMDIR /S /Q "%G"
I tried:
rm -rf .git
and also
Git keeps all of its files in the .git directory. Just remove that one and init again.
Neither worked for me. Here's what did:
.git
Then create / restore the project from backup: