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 trialNathan Brenner
35,844 Pointshow 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
Agapito Cruz
21,486 PointsHello 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
Berthony Louis Jeune
4,135 PointsThat's also answer my questions. Thanks you guys.
Tsitsi Moyo
6,149 PointsI also needed these answers,thank you very much.
Ricky Catron
13,023 PointsRicky Catron
13,023 PointsWarning: 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
39,199 PointsJames Barnett
39,199 PointsTo expand on what Ricky Catron mention about
rm -rf
The
rm
command is for remove-r
switch means recursive and-f
means force. Sorm -rf
deletes every file without warning in the directory specified.So the danger with
rm -rf
is accidentally specifying an incorrect directory.