hey i'm cameron mckenzie i'm the editor-in-chief over at the serverside.com and you can follow me
on twitter cameronmcnz and i'm going to tell you how to find the github repository url
and show you how to use it anytime you create a github repository you get a github repository
url i'm going to go to my list of repositories in github here and actually just click on that green
new button and create a new repository just going to be simple public throw readme in there add an
add a git ignore an apache license click create the repository and now we are going to see this
git repository url can you see it okay maybe you can't see it because it's hidden underneath here
there it is right under code it actually has that github repository that's it there
and there's syntax that it takes it's just github.com and then the name of user the
repository name dot git and so there you go you can click this little button to copy it
ctrl c that copies the url now what good is that url well you know you can always come over here
and i'm in my home directory you can always issue a git clone provide the name of that url
and all of a sudden you've got a cloned repository there it is right there
new repository yeah that's the name of it cd in there there's my files my license my readme
can add a hello world
do a commit
oh and then i messed that up good commit message kind of double quotes
and then you can always do a git push back to origin
and there we go we've pushed back and now if i do an ls you can see i've got that
hello world file there if i do a refresh here there's no hello world yet but now
there is now and just one thing to note with that repository you know you've got that url
on the client if you come over to settings here anytime you change the name of the repository so
i'll call it new repository name just to change the name that's how you rename a repository
notice that after renaming it it actually gets a new name here so it's actually called new
repository name instead of new repository and so that git repository url will change
you know if you change that repository now the nice thing is if you actually do uh
if you go in here and create a new file and add it to the index and then do a git commit
and then do a git push origin operation you would think that this would fail because the url is new
and the git push uses the url just as does a fetch and a clone let me put my credentials in here
but you can see it's actually successful and if i go over here and refresh even though the
url's changed i've got that new file and if i come here take a look at the terminal you
can actually see that it's giving me a little bit of information it's saying hey you know
this repository moved please use the new location next time you do a fetch or a pull
and the new location is new repository name so it's just kind of cool it keeps
in sync but also if you change it the server maintains a record so it knows how to redirect
and there you go that's everything you need to know about the github repository url
i'm the editor over with the server side so if you want to learn more about git github
and everything that has to do with devops and server side development come over and join me
and if you want to follow me and my antics you can always follow me on twitter at cameronmcnz