Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools Git Basics Getting Started With Git Repository Basics

Git Basics

"Oops! I just decided we're in the wrong folder. Let's remove the git repository we just created." what is the command to answer this question please.

2 Answers

Chris Shaw
Chris Shaw
26,676 Points

Hi Jihard,

I recommend you go back and watch Working With Git Repositories as Tommy Morgan explains how to remove a folder using the rm command which is about 4 minutes in.

I tried rm but its not working for some reason.

Chris Shaw
Chris Shaw
26,676 Points

The rm command by itself won't work because .git is a directory, as Tommy explains you need to use a flag which he shows in the video when using rm.

Zack Klinger
Zack Klinger
17,622 Points

Everything that makes a directory a git repository is located in a 'hidden' folder named .git/ that sits in the root folder of the repository. If you remove the .git/ folder from any git repository on your local drive it will leave all of the files but remove any git tracking. If you just remove the whole folder with all of your working files, the .git/ folder will be removed as well.

Then you can simply git init a new repository and you'll see that hidden .git/ folder gets created.

Hope that helps. Also, like Chris Upjohn wrote, look up the flags for rm so you know what you are doing.