Skip to content
← Back to Community
Configuring GitHub repos to run on Repl.it and contributing back
Profile icon
h
has Hacker Plan
amasad

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 repl.it 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 repl.it and how you can contribute back a neat "run on repl.it" button to the repo. It looks like this:

This file cannot be displayed: https://repl.it/badge/github/plibither8/2048.cpp

I'm going to use this repo (https://github.com/plibither8/2048.cpp) as an example. (It's an implementation of 2048 in C++ that works in the terminal!)

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

Screen Shot 2019-12-09 at 1.34.21 PM

Then add in the repo url:

Screen Shot 2019-12-09 at 1.35.51 PM

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.

Screen Shot 2019-12-09 at 1.36.41 PM

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:

Screen Shot 2019-12-08 at 8.03.51 PM

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

Screen Shot 2019-12-09 at 1.40.22 PM

Screen Shot 2019-12-09 at 1.42.58 PM

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

Screen Shot 2019-12-09 at 1.44.43 PM

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: https://github.com/plibither8/2048.cpp/pull/117

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

Voters
Profile icon
programmeruser
Profile icon
RayhanADev
Profile icon
NEED1
Profile icon
KarthikRamachan
Profile icon
ceilingrat
Profile icon
wjnb
Profile icon
CodingGoose
Profile icon
CoolJames1610
Profile icon
calebGarrick
Profile icon
HomewardBound
Comments
hotnewtop
Profile icon
Grify

Any planned support for other git platforms like BitBucket? (the one I use) or GitLab? (the one my dad uses)

Profile icon
lucasverra

this is a game changer. The PR maker is awesome for viral effect :)

Profile icon
amasad
Profile icon
rediar
Profile icon
Zavexeon

73 notifications... lol.

Has this update been causing instability on repl.it? I've gotten the heroku error page twice.

Profile icon
[deleted]
Profile icon
Elizabeth11
Profile icon
Elizabeth11
Profile icon
Elizabeth11
Profile icon
Mohammad-Fahad2

BTW, this one and a couple of others will in any case blunder in light of the fact that no token has been given, however, they take care of business.
https://www.imybkexperience.com/
https://www.mykfc-experience.com/
https://www.mybpcreditcard.one/

Profile icon
Mechakleopteryx

Before running the build command, "cd build ...etc", I had to run the command "mkdir build".

Profile icon
[deleted]

how export?

Profile icon
ceilingrat

Hi @amasad !

Do you have any information about how the 'Run on Repl.it' button will be affected by the sunsetting of anonymous repls? ( https://blog.repl.it/anon )

I'm preparing to give a lightning talk about Repl.it, focused on the 'Run on Repl.it' button and I'd like to anticipate what changes are in store.

Many thanks!

Profile icon
ceilingrat

I see now that the changes are already rolled out, so I can answer my own questions. Sorry, don't mind me!

Profile icon
artystable

Great thanks!

Profile icon
LaylaAli1
Profile icon
Scoder12

Scoder12#1704 on discord
https://github.com/cwc/OmegaRPG/pull/30

Profile icon
Scoder12
Profile icon
Kognise

Discord: Kognise#6356

https://github.com/kognise/repl.it-mobile/pull/7
https://github.com/HospitalRun/hospitalrun-frontend/pull/1667
https://github.com/kognise/water.css/pull/164
https://github.com/automerge/automerge/pull/225
https://github.com/picturepan2/devices.css/pull/9
https://github.com/tailwindcss/playground/pull/11

Profile icon
Scoder12

@Kognise I seem to recall a "You can't send pull requests to yourself" rule...

Profile icon
[deleted]

most funnily because he lists my water.css request as his lol
@Scoder12

Profile icon
Kognise

@enigma_dev Yours didn't even work, mostly because your .replit file was broken

Profile icon
[deleted]
Profile icon
piemadd
Profile icon
piemadd
Profile icon
piemadd
Profile icon
piemadd
Profile icon
piemadd
Profile icon
HarshdeepKahlo1

Discord Username: ozaiworld#6551

Profile icon
dialogarithm
Profile icon
AllAwesome497

@dialogarithm pay attention before you make the pull requests, you made a second one 13 hrs after I did and mine was never closed. https://github.com/unknownblueguy6/MineSweeper/pull/5
https://github.com/unknownblueguy6/MineSweeper/pull/6

Profile icon
AdCharity

:D I like this new github feature (really makes it easy 4 a lot of projects). Honestly tho the only thing I really saw were the 70 notifications on the images lmao

Profile icon
amasad

@AdCharity wdym "notifications on the images"?

Profile icon
[deleted]

in the upper left [email protected]

Profile icon
AdCharity

@amasad the little bell thing in the upper left corner

Profile icon
MrEconomical
Profile icon
joshwood
Profile icon
joshwood
Profile icon
joshwood
Profile icon
joshwood
Profile icon
joshwood
Profile icon
joshwood

This one's got 5k+ stars:
https://github.com/chubin/wttr.in/pull/381
(I think this one's likely to merge, just it isn't merged yet.)

Profile icon
joshwood
Profile icon
joshwood
Profile icon
AllAwesome497
Profile icon
mmbnforlife
Profile icon
slip1244
Profile icon
slip1244
Profile icon
vityavv
Profile icon
vityavv
Profile icon
vityavv

@vityavv https://github.com/FlyingKatsu-Discord-Bots/Discord-GitLab-Webhook/pull/16

BTW, this one and a few others will still error because no token has been provided, but they do work

Profile icon
vityavv
Profile icon
vityavv
Profile icon
vityavv

@vityavv https://github.com/DiscordBotList/Luca/pull/42 this one you have to add the token to the end

Profile icon
LeVi0826
Profile icon
LeVi0826
Profile icon
LeVi0826
Profile icon
LeVi0826

this one is a little late because of bugs https://github.com/go101/go101/pull/141

Profile icon
shiv213
Profile icon
artemis21
Profile icon
artemis21
Profile icon
artemis21
Profile icon
Mooopy
Profile icon
Mooopy
Profile icon
Mooopy
Profile icon
VexeDev
Profile icon
VexeDev
Profile icon
VexeDev
Profile icon
VexeDev
Profile icon
VexeDev
Profile icon
VexeDev
Profile icon
VexeDev