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

Nathan Brenner
Nathan Brenner
35,844 Points

how to remove repository that was added without a name

I created a repo without a name on my pc git, and it put everything on my computer on that repo. If I didn't give that repo a name, how do I do that? How do I remove that repo if I don't have a name for it?

3 Answers

Hello Nathan, I'm a little unclear as to what you mean when you say you created a repository without a name. If you mean that you issued the command: git init, without specifying a name then the repository resides in the directory/folder you were in when you issued the command. It is in a hidden directory called .git. to remove it just rm .git, or rm -rf .git to recursively remove any subfolders in the .git directory.

I hope this helps.

-Agapito

Ricky Catron
Ricky Catron
13,023 Points

Warning: be very very very careful with these commands.

rm .git rm -rf .git

They are powerful and if typed incorrectly can do lots of damage.

James Barnett
James Barnett
39,199 Points

To expand on what Ricky Catron mention about rm -rf

The rm command is for remove -r switch means recursive and -f means force. So rm -rf deletes every file without warning in the directory specified.

So the danger with rm -rf is accidentally specifying an incorrect directory.

That's also answer my questions. Thanks you guys.

I also needed these answers,thank you very much.