GitHub Repository: Explained Like I'm Five
Tags: github, git, beginners, webdev
Published: 2020-10-19 13:27:46

In Programming or in Github, we usually see a repository as a folder for your project which contains all of your project's files and stores each file's revision history. Github allows users to create either a private repository or public repository depending on the user. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/2x5z3hlkjw60v0lav441.png)

A short form for a repository is 'repo'. You can own repositories individually, or you can share ownership of repositories with other people in an organization.

## Creating a Repository

Once you have a Github account, you can easily create a repository. if you are logged in you can easily visit https://github.com/new to create a new Repo or make use of any of the options in the image below.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/rw39wtxi3cjp9t17pmx8.png)

Once that is done you would need to fill the form that appears, You will fill in the repo name, a little description(optional), choose if you want a private or public repo, you can also add a README file, e.t.c. Once you are done filling the form, click on the "Create repository" button.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/zabmjffs0un2emfswxwm.png)

## Public vs Private Repository
This is usually referred to as repository visibility. This allows you to restrict who has access to a repository by choosing a repository's visibility: public, private, or even internal for Github enterprise account usually for an organization. 

Public repositories are accessible to **everyone** on the internet while Private repositories are only accessible to you and people you explicitly share access with. 

When a project or repository is active you can always change its visibility.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/eqn1fq6dq0n2cn5vtzko.gif)

For user-owned repositories, you can give other people collaborator access so that they can collaborate on your project.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/exlei3w293oeqkb2shtc.png)

>**Note:** To invite a collaborator you would need either the username, full name, or email the individual used to open his/her GitHub account.

That's all about creating a Github repository.

> **Note:** Creating a repository simply means you have set up your project folder, the next phase would be to either create files on your repository or upload files from your local computer to your repository.

This can be achieved either by doing the regular upload of files we are all familiar with or we make use of git via your Command Line Interface (CLI). I will leave everything about git and the CLI for a dedicated [topic](https://dev.to/olawanle_joel/git-explained-like-i-m-five-ccd).

## Creating & Uploading files on Github
To create a file on GitHub is very easy, click on the **create a new file** link/button and input a file name. If you want to upload, it's also very easy, you just have to click the **upload an existing file** link/button and upload your files. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/dar8pia3gqz18iubjxt8.png)

or this if you already have some files in your repository

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/8cw38heh8borq5q7ytfm.png)


*To round up everything about repositories, the last thing I will be explaining is how to clone a repository and why we clone repositories.* 

## Cloning a repository from GitHub
When you create a repository on GitHub, it exists as a remote repository. You can clone your repository to create a local copy on your computer and sync between the two locations. 

There are so many options that could be used to clone a repository. You can either make use of git by copying the remote URL, download a zip file or open with Github desktop. It depends on you. I would explain everything about git [here](https://dev.to/olawanle_joel/git-explained-like-i-m-five-ccd).

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/8fyd6i964yi64a1ej0n1.png)

****

As always, any questions or suggestions, please feel free to leave a response or [tweet me](https://twitter.com/olawanle_joel) 🤭! Be sure to connect with me on socials! 😎