- [Cameron McKenzie] Hey, I'm Cameron McKenzie.
I'm the editor-in-chief over at www.theserverside.com
and you can follow me on Twitter @cameronmcnz
if you are so inclined.
But right now I wanna talk to you about
how you go about deleting a GitHub repository
and specifically deleting it from the GitHub server.
And by the way, it's not that hard.
Just to go to settings
and then find the deleted repository choice at the bottom.
But there are implications to doing that.
And one of the implications is once you delete it
people that have the repository on their local machines
won't be able to push to it anymore.
Now, again, when you delete the repository from GitHub
it doesn't delete it from all of the client machines.
So this is a GitHub delete only.
If you want to delete it from the client machines,
you gotta go to those client machines and delete the folder.
Now here's my GitHub account
and you can see www.github.com/cameronmcnz,
also my Twitter handle.
And I've got this github-made-easy project that I created,
oh, just moments ago actually.
You can even see here I've gone in and I've cloned it.
You can even see the Git status on my local machine.
I'm on branch master.
All the different files there.
So yeah, I mean, I've got this GitHub repository
named github-made-easy.
I don't want to delete it.
So, how do you go about doing that?
So once again, you go to your list of repositories.
You find the repository that you want to remove.
You click on it,
and then there's this option for settings up here.
So hammer on the settings
and when you scroll right down to the bottom
you'll see there's this option to delete the repository.
So, that's what you were looking for.
I mean, if you were just wondering, how do you delete it?
That's it there.
You click the Delete this repository
and then you gotta type in the name of the repository
because, I mean, you can do a little bit of damage
by deleting a repository on Git.
Now, in a distributed version control system
everybody theoretically has a full copy of the repository
but still, you don't want to delete your repository
if you don't mean to.
So you've gotta confirm by typing the whole name in.
I just did a copy and paste there cause I'm lazy.
But yeah, I understand the consequences
of deleting this repository.
So I'm gonna click the big red button.
(keyboard clicking)
And all of a sudden my repository is gone.
If I take a look over at cameronmcnz,
see my repositories, look for it.
Yeah, it's definitely gone.
I don't have the github-made-easy repository.
Now, here's the funny thing.
If I go over to my client application,
(keyboard typing)
the client application, my local machine,
the terminal where I cloned to,
it's still got that git-made-easy project.
If I do a 'ls -a', you can still see that,
'.git' folder
and I've still got everything right here locally.
So, you can delete the Git repository on the GitHub server,
but that doesn't delete it everywhere.
So, some people will have to go to their local machines
and delete it on their machines as well.
Just delete the folder.
But certainly if I was to try and push.
So I could do a touch 'delete.html', 'git add .',
'git commit -m'.
Always do a good commit message
and then I try to do a 'git push origin'.
(keyboard clicking)
After I put in my username and password,
I'm gonna get this fatal error.
Hey this repository is not found.
And of course it shouldn't be found
because I just deleted it.
Of course that was the whole goal of this tutorial.
And there you go.
That's how easy it is to delete a GitHub repository.
Now, by the way, if you want to learn more about Git,
GitHub, Devops and Server Side development,
I'm the editor-in-chief at www.theserverside.com,
so head over there and check out what we're writing about.
And if you wanna follow some of my antics
you can follow me on Twitter.
My handle @cameronmcnz.