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 Working With Git Repositories

How do you delete a repository if you misspelled it?

I just realized I misspelled my repository name on the nano command line? I couldn't find any documentation to figure this out. Any help on this would be greatly appreciated.

2 Answers

Michael Hulet
Michael Hulet
47,912 Points

If you want to remove a git repository from a folder, you just need to delete the hidden .git folder, as Torben Korb said. If you're doing this from the command line, you just need these commands:

# Make sure you're in the directory of the repository you want to delete
cd path/to/project
# Delete the repository folder and everything in it
rm -r .git

Why is this not working? This is what I am seeing in the console:

treehouse~/my_first_repsository $ ls -a
.  .. file1  file2 file3
treehouse~/my_first_repsository $ rm -r .git
rm: cannot remove 'git': No such file or directory

I've already had my console reset before and I would like to avoid having to do that again if at all possible.

Michael Hulet
Michael Hulet
47,912 Points

According to ls -a, there is no .git folder, which means that you've already deleted it