Optional: How to turn your project to a Git repo and share it

Objectives

  • Turn our own coding project (small or large, finished or unfinished) into a Git repository.

  • Be able to share a repository on the web to have a backup or so that others can reuse and collaborate or even just find it.

Exercise

Illustration of how we turn a project into a Git repository and share it

From a bunch of files to a local repository which we then share on GitHub.

Exercise: Turn your project to a Git repo and share it (20 min)

  1. Create a new directory called myproject (or a different name) with one or few files in it. This represents our own project. It is not yet a Git repository. You can try that with your own project or use a simple placeholder example.

  2. Turn this new directory into a Git repository.

  3. Share this repository on GitHub (or GitLab, since it really works the same).

We offer three different paths of how to do this exercise.

  • Via GitHub web interface: easy and can be a good starting point if you are completely new to Git.

  • VS Code is quite easy, since VS Code can offer to create the GitHub repositories for you.

  • Command line: you need to create the repository on GitHub and link it yourself.

Create an repository on GitHub

First log into GitHub, then follow the screenshots and descriptions below.

Screenshot on GitHub before a new repository form is opened

Click on the “plus” symbol on top right, then on “New repository”.

Then:

Screenshot on GitHub just before a new repository is created

Choose a repository name, add a short description, and in this case make sure to check “Add a README file”. Finally “Create repository”.

Upload your files

Now that the repository is created, you can upload your files:

Screenshot on GitHub just before uploading files

Click on the “+” symbol and then on “Upload files”.

Is putting software on GitHub/GitLab/… publishing?

It is a good first step but to make your code truly findable and accessible, consider making your code citable and persistent: Get a persistent identifier (PID) such as DOI in addition to sharing the code publicly, by using services like Zenodo or similar services.