Repositories#
Before we can explore some additional git
commands like clone
, we need a repository.
Click this button on your GitHub profile to start the process:
Under Repository name
key in uploadacademy-itopslevelone-a
. You can technically call it whatever you like, but I'll be referring to it by that name going forward.
The Description
field can be left blank or filled in - whatever makes you happy.
The Public
or Private
options determine if only you can see what's inside the repository, or if the rest of the world can see what's inside of it. I recommend going private for this particular repository as it's not really going to be providing any public good.
There's an option now to, "Initialize this repository with:", followed by some items you can add to the repository. As we're learning to clone a new repository here, let's click Add a README file
.
We'll skip the Add .gitignore
and Choose a license
options. These don't concern us right now.
Now click Create repository
. Congrats! That's your first repository on GitHub!
What's happening here?#
Git is, by design, a decentralised version control system, but GitHub acts as a centralised solution for hosting the "master" copy of the repository so that others can work with it too.
Simply put, instead of doing git init
your self locally, GitHub is doing it for you remotely and then hosting the repository on their servers. Remember that we said previously that a Git repository is essentially a directory with a .git
directory inside of it. That's all GitHub is creating and hosting for you (but with lots of cool tools and features wrapped around it.)
GitHub then lets you (and potentially others) clone
or pull
the repository to your local machine, and push
content (changes) from your local machine to the remote servers for others to work with.
This is how open-source software is developed - everyone works against a central code base that they clone
/pull
, make some changes, push
their branch to the remote server, and then those changes, if agreed upon, are merged into the master
branch of the remote copy of the repository.
Let's look at using git clone
, next.