Configuring GitHub repos to run on and contributing back
amasad (3457)

You might have noticed that it's now possible to import your GitHub repos into repls. If you haven't yet, consider connecting your GitHub account to to make it easier to import and contribute back.

In this guide I'm going to show you how to configuring a repo to run on and how you can contribute back a neat "run on" button to the repo. It looks like this:

I'm going to use this repo ( as an example. (It's an implementation of 2048 in C++ that works in the terminal!)

First let's import the repo to Click "import repo" from the header.

Then add in the repo url:

Click "create from GitHub" and after the repo clones you'll see a configuration pane to figure out the language and how to run the repo.

Now, you have to try to figure out the run command from the repo. Typically, you'd want to read the instructions in the readme or play with it in the shell to figure out how to best run it. In this case I figured out that:

  1. The language is cpp (from the name duh)
  2. From the readme I figured out that the run command should be cd build && cmake ../ && cmake --build . && ./2048

Click "done" and then you'll see two things:

  1. A .replit file: This is where the configuration gets saved
  2. The config pane gets replaced with instructions on how to contribute the run badge and configuration back to the repo

Before we get to contribute back let's make sure it actually runs:

Sweet! Now follow the steps in the pull request pane which should give you code to paste in the readme:

Preview the readme and make sure the "run on" button renders correctly:

Now simply click on "prepare pull request" which will take you to GitHub where you can fill in the rest of the details. For this repo, I already sent a pull request. Check it out:

I'm excited to see more badges all over GitHub so that all repos can be easily run. Please help people get their repos work on and in the process contribute to open source!

You are viewing a single comment. View All