GitHub is a popular web site used by developers to host and work together on code. Using the GitHub integration in MakeCode, you can easily and freely host your programs and collaborate on them with friends.

To use GitHub, you need an account and internet access. You don’t need to know anything special beyond what you’ve already learned in MakeCode.

I want to program on my own

Let’s start discovering GitHub by explaining a common usage scenario: you are editing your own project and using GitHub to save your changes.

Step 1 - Create a repository

A repository is used to organize a single project. Repositories will contain all the files needed for your MakeCode projects.

  1. Open the editor, create a new project
  2. Click on the GitHub button next to the Save button.
  3. Select a good name and description (it helps with internet searches!).

Sign in

If you haven’t signed in yet with GitHub, you will be redirected to the GitHub sign page. On your first use of MakeCode, you will also be asked to authorize the Microsoft MakeCode with GitHub app. This integrates MakeCode

Advanced users can use a developer token so that they can work directly with GitHub without having to sign in with the app.

Step 2 - Commit & push changes

Make any change in the code editor and you will notice that an up arrow is displayed on the GitHub button. The arrow means that there are changes stored on your computer and they need to get saved to GitHub. Click on that button to open the GitHub view.

You will see a commit & push changes button and a list of diffs under it. A commit is a bundled set of changes that can be uploaded to GitHub (read more about commits). A diff is common jargon used by developers to describe a formatted display of differences between two pieces of text (read about using diffs). Look at the diff carefully, it tells you which lines you added, deleted or modified.

Review your code

It’s always a good idea to review the changes you’ve made to your code before committing them!

Click on the commit & push changes button to save these changes to GitHub.

Step 3 - Reverting local changes

Go back (there’s a go back button you can click) to the code editor and make another change. Click on the GitHub view to see diffs of your changes.

You will notice a Revert button next to the modified file. It allows you to undo all the changes in that file and roll it back to the content in the previous commit.

Click on Revert to see how it works.

Classroom usage

GitHub can be used to create and collect assignments from students. Learn more… or quickly review their repositories in the Explorer

Repository as web sites

MakeCode uses GitHub Pages to turn your repositories into web sites! This is a great way to build your portfolio or share a playable game with friends.

Frequently Asked Questions

Do you have more questions? Try the FAQ.