Creating a GitHub repository

Eric Bezzam
5 min readJan 14, 2024

This post is a part of a (planned) series on “Collaborative Coding with GitHub”, a workshop that I’ve given several times at EPFL (through LauzHack) to help students and researchers familiarize themselves with Git and GitHub. The posts are meant to complement the workshop, whose material (slides and recording) can be found here. However, the posts can also be used as a standalone guide. Enjoy!

In this post, we will walk through the steps of creating a new GitHub repository, or “repo” for short. A repo is another way of saying “project” or “folder”. It is a place where you can store files, such as code, images, and text, and the git protocol will keep track of the changes you make to those files. This is called version control.

Creating a repo on GitHub will create a “remote” repo on GitHub’s servers (as opposed to a “local” version on your computer). You can view a remote repo as a backup or centralized location for your project, which is useful when you’re working on multiple computers, with other people, or if your computers crashes!

GitHub provides a nice interface for creating and managing repos, with useful features that may not be obvious at first. Let’s look at some of them for creating a repo!

🏃 GTG (Go to GitHub)

First thing of course is to log in to GitHub. If you don’t have an account, you can create one for free. Once you’re logged in, you should see a page like this:

We’ll go ahead and click on the green “New” button to create a new repo.

Initialize your repo settings

You’ll now be taken to a page that looks like this:

Here we’ll see one of GitHub’s strengths: an intuitive interface that guides you through the process of creating a repo. Let’s go through each of the fields, and don’t worry if you change your mind, you can always change these settings later!

1) Repository name and description

This is the name of your repo. It will be used in the URL of your repo, so it’s best to keep it short and simple. You can use hyphens to separate words, but not spaces. For example, if you want to create a repo for your school project, you could name it my-school-project

And you can optionally provide a description of your repo. This will only be displayed on the repo’s homepage on GitHub.

2) Public or private?

“Back in my day”, GitHub only allowed public repos for free, meaning anyone could view the contents of your repo. This was great for open-source projects, but not so great if you wanted to privately work on your code till it was clean and useable enough. GitHub now allows you to have unlimited private repos.

I recommend keeping your repo private until you’re ready to share it with the world. You can always change this setting later.

3) Initialize with “boilerplate” files

A README contains important information about your project (installation, how to use, etc). The file name is typically in all-caps to grab the user’s ATTENTION, as the first thing to look at. On GitHub, the README serves as the homepage for your repo. It will be displayed on the repo’s homepage, and will be the first thing people see when they visit your repo. A common syntax for README files is Markdown, and if you decide to, GitHub will add a README.md file (namely a Markdown file). It’s a good idea to have a README, so I recommend checking this box. You can always delete/change it later, e.g. if you make documentation with Sphinx and will need a README.rst file instead of a README.md file as created by GitHub (confused? more on that in another post!).

A .gitignore file is also really useful to have! As the name says, it tells the git protocol to ignore certain files. The templates that GitHub provides are pretty good, so I recommend picking the one for the primary programming language of your project. For example, for Python, it will ignore files that end in .pyc (compiled Python files) and .env (environment variables). You can always add/remove files from the .gitignore file later.

Finally, for any project, you’ll want to have a LICENSE file. This tells people what they can and cannot do with your code. For example, if you want to make your code open source, you can use the MIT license. If you want to make it free for non-commercial use, you can use the Creative Commons license. GitHub provides useful info on different ones you can pick from the dropdown. You can always change it later. If you don’t have a license, the default is that people can’t do anything with your code! (Similarly you should be careful about using code that doesn’t have a license, and contact the author to provide a license!)

Press the button!

And that’s it! Go ahead and press the green “Create repository” button. You’ll be taken to your repo’s homepage, which will look something like below.

Now that you’ve created your repo, you can start adding files to it, and synchronize it with code on your or your friend’s laptop. But first, we need to get this remote repo on our local computer. In the next post, we’ll see different ways of doing that. For now, enjoy your project that does absolutely nothing 👏

--

--

Eric Bezzam

PhD student at EPFL. Previously at Snips/Sonos, DSP Concepts, Fraunhofer IDMT, and Jacobs University. Most of past work in audio and now breaking into optics!