0

I am trying to run the command git rm -f .git. It is saying

'.git' did not match any files.

I can't recall if it is the exact command, but clearly something is off and I have been unable to find online what I'm looking for. The issue I am trying to resolve is delete the .git file. Can anyone advise?

2
  • 1
    Do you really want to remove the .git folder? That deletes the repository with all the history. If you have no backup repo, it will be lost forever. Commented Aug 18, 2015 at 6:48
  • Take a look at my answer Commented Aug 18, 2015 at 9:28

1 Answer 1

1

If you want to actually delete the .git folder, just run

rm -rf .git

I don't think git rm will allow you to delete the .git folder, as that is what defines the repository itself.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks. I think that worked - pretty obvious in hindsight, but I'm a tad rusty. I'll accept in a few minutes when I'm allowed
git rm won't work because it tells git to remove files from it's working directory, which .git is not a part of.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.