Skip to article frontmatterSkip to article content

Here, we provide step-by-step instructions to get started with GitHub.

1. Create a GitHub account

Go to https://github.com/ and create a new account using the sign up to GitHub box.

2. Create a repository

When you have created a new account and you are logged in, you need to create a new repository.

A repository or repo is the online space where you store all of the documents, data and other files for your project.

This is what you should see now. It is the landing page for your repository. The diagram below explains what all the buttons, tabs and other things do!

Annotated diagram of repository after its creation, explaining the main features. The main features are explained in the figure legend.

Figure 1:Annotated diagram of repository after its basic creation, explaining the main features. On the left side of the webpage we have the following features:

  • 1. Username: GitHub user’s name (account). In this example, the username is “EKaroune”.
  • 2. Repository: project directory (also known as repo). In this example, the repository name is “trial-repo”.
  • 3. Code: this tab brings you back to your landing page. It shows you the folders that you have made in the repo.
  • 4. Main: this is your default development branch or active branch of your repository.
  • 5. Branch: parallel version(s) of your repository.
  • 6. README.md file: this file contains basic information about your project (in this case it only has the project name: “trial-repo”. When we plan to make a website, this will be rendered as a landing (front) page for your site.

On the right side of the webpage we have the following features:

  • 7. Green Code button: click it to download your repository locally.
  • 8. ‘+’ symbol: where you can create new repository, import repos and create new issues.
  • 9. Fork: create a personal copy of another user’s repo. The number shows how many forks there are of your current repository.
  • 10: Add file: create or upload a file to your repository.
  • 11: Commits/clock symbol: click to see the history of this file as a list of all the edits (commits) saved at different time points.
  • 12: Edit/Pencil symbol: click this pencil symbol to edit your README.md file.

3. Edit your README.md file

Unless you have added any other files or included a license file during repo creation, you should have one file in your repository now - README.md. We’ll need to edit this file to add information about the repo. This file is a Markdown file; you can see this because it has “.md” after the name of the file. This is where you start to use the Markdown formatting. Whatever you write in this file will be shown on the landing (front) page of your project on GitHub, so use it to tell people all about your project.

To edit your README.md file:

Or

You can now edit the file. We’ll talk about how to save your changes after some pointers on writing a good README.

Annotated diagram of README.md file, if you click on the file name on your landing page. The main features are explained in the figure legend.

Figure 2:Annotated diagram of README.md file, if you click on the file name on your landing page.

  • 1. Repository and current file: the repo name and the name of the file you are viewing.
  • 2. Main branch: currently active branch (“main” is the default). Use to change to different branches of your repo (if there are more branches previously created).
  • 3. Contributors: number of contributors (users) to your file.
  • 4. README.md file content: the content of your README.md file appears here. This content will expand once we add more information..
  • 5. Raw file: view the raw markdown text file.
  • 6. Blame: view the last modification made to each line of the file. It can be used to track when and who made changes and go back to older versions of the file to fix bugs.
  • 7. Edit file: click this pencil to edit your README.md file.
  • 8. Delete file: click the bin to delete this file.
Annotated diagram of README.md file in edit mode – before editing. Explained in the title.

Figure 3:Annotated diagram of README.md file in edit mode – before editing.

  • 1. Preview changes: press to see your text rendered (how it would appear on GitHub or on a web page).
  • 2. Edit file: press this tab to edit the content of your README.md file.
  • 3. Add content to README.md: write the Markdown text for your README.md file. You currently only have the repository title in this file.

Tips for writing your README file

NOTE: If you’re having trouble getting started, it’s a good idea to look at other peoples’ README.md files.

If you can’t get your raw markdown content to render in the way you want, it is also a good idea to find a file that has what you want and then look at the raw file. You can copy and paste other people’s raw file content into your README.md file and then edit it.

Here is an example of a really well formatted README.md file: STEMM Role Models App

If you click the link above, it will take you to their README file. You can use this as a template for your README.md file.

Annotated diagram of README.md file in edit mode – with a template added. Features are explained in the figure legend.

Figure 4:Annotated diagram of README.md file in edit mode – with a template added.

  • 1. Using MarkDown to add content to README.md: the Markdown (denoted by ‘.md’ in the file extension) text for your README.md file. This example shows the template file that has different sections (headers and subheaders are created by using one or more of ‘#’ symbol. See the formatting consistency section of the Community Handbook for some more information on using Markdown.

Committing - or saving - your changes

Committing your changes is like hitting the “save button” for a file. GitHub will not automatically save your changes, so it’s important not to skip this step.

Whatever changes you have made in the file will be deposited into your repository.

It is good practice to write a descriptive commit title and a short description of what you have done in the commit changes box. So something like - commit title: ‘first edit of the readme file’; description: 'copied template from … and edited it with the details of this project’. This information about the commit is called a “commit message”, and the commit title will enable you to quickly look through the history of changes for a file (which is why making them descriptive is so important - it’s like leaving a helpful note to your future self).

You can see a list of your commits (or your “commit history”) by clicking the clock symbol on your landing page or within the page for each file.

4. Add a license to your repository

It is important that all of your work has a license from the very beginning or no one can reuse it. Licenses tell other researchers how they are able to reuse, modify and remix your work. No license implies that others are not allowed to use your work, even with attribution. So it is better to include a license that lets people know what they can and can’t do and how to give you credit for your work.

Depending on your field, much of your work may be documents with only some data or code. The standard licenses offered on GitHub are most appropriate for software and won’t really be the right kind for documents.

Creative commons licenses are the best to use for this purpose, and the most open of these is the CC BY 4.0.

To add a license to your repository, the first thing to do is create a LICENSE.md file:

You can find more information about licenses in the Licensing chapter of The Turing Way.