GitHub: fork, clone, push, pull requests, CI checks

Learn GitHub from zero by forking the Beacon Yard Roblox game repository: clone, push, open a pull request, read CI checks, and file a useful issue.

Tool lesson, about 55 minutes, 17 steps

By the end you can

  • Fork the Beacon Yard repository, clone your fork, and sign Git in to GitHub.
  • Push a branch, open a pull request in your fork, and read its CI checks, including a failing one.
  • Keep your fork up to date, and ask for help with a well-written issue.

Before this: Roblox and GitHub accounts, 2-step verification, age checks and safety, Git from zero: commits, diffs, branches, undo

1From one laptop to everywhere

Your practice repository from the last lesson lives in one folder on one computer. If that computer breaks, the history goes with it. Nobody else can see your work, review it or build on it.

GitHubGitHubA website that hosts Git repositories and adds pull requests, issues and automatic checks.Think of it as a shared warehouse for save folders, with a notice board and a quality inspector. hosts Git repositories online. A copy of your repository on GitHub is a remoteRemoteAnother copy of a repository somewhere else, which you can push to and pull from.Think of it as a copy of the save folder kept in the shared warehouse.: another place the same history lives. You push commits up to it and pull commits down from it. GitHub adds what Git lacks on its own: pull requests for discussing changes, issues for tracking problems, and automatic checks that test every change.

Beacon Yard itself lives on GitHub. In this lesson you get your own copy of the whole game.

What is a remote?

  1. A program that controls Studio
  2. Another copy of the same repository, somewhere else, that you can push to and pull from
  3. A GitHub account
  4. A branch called remote
Answer

Another copy of the same repository, somewhere else, that you can push to and pull from. A remote is just another place the repository lives. GitHub is the most common one.

Open this step in lesson mode · Link to this step · This confused me

2Fork, clone, push, pull request

Four words describe the whole journey:

Diagram
Fork, clone, push and pull request. On GitHub, the course repository is forked into your fork. Your fork is cloned to your computer. Your computer pushes branches back to your fork. A pull request asks to merge a branch, inside your fork or into the course repository.
Figure 2.1.

Fork once on GitHub, clone once to your computer, then push as often as you like.

  • A forkForkYour own copy of someone else's repository, on GitHub, under your account.Think of it as your own photocopy of the master plans that you may mark up freely. is your own copy of someone else's repository, on GitHub, under your account. You can change it freely.
  • A cloneCloneA copy of a repository on your computer, already linked to the remote it came from.Think of it as photocopying the whole save folder, history and all. is a copy of a repository on your computer, already linked to the remote it came from.
  • To push is to send your new commits from your computer to the remote.
  • A pull requestPull requestA request to merge one branch into another, with a page for discussion and checks.Think of it as a handover note stapled to your branch: please review and merge. (PR) asks for a branch to be merged, with a page for discussion and checks.

Match each word to where it happens.

  1. Fork
  2. Clone
  3. Push
  4. Pull request
Answer

Fork: github.com: copies a repository into your account; Clone: Your computer: downloads a repository with its history; Push: Your computer to GitHub: uploads your commits; Pull request: github.com: asks for a branch to be merged. Fork and pull requests happen on the website. Clone, push and pull are Git commands you run on your computer.

Open this step in lesson mode · Link to this step · This confused me

3Fork Beacon Yard

Sign in to GitHub and open the Beacon Yard game repository, https://github.com/ReimagineMedias/beacon-yard. Click Fork near the top right. On the next page keep your account as the owner and the name beacon-yard, then click Create fork 1.

A few seconds later you are looking at YOUR-NAME/beacon-yard, with a line under the name: forked from ReimagineMedias/beacon-yard. That repository is yours.

Fork: your own copy of Beacon Yard, under your account.

Turn on Actions in your fork now. GitHub leaves automatic checks switched off on a new fork, so nothing would run later. Open the Actions tab of your fork and click I understand my workflows, go ahead and enable them. The checks are the game's own, and they only ever run in your fork.

Build along

m00-baseplate

  1. Fork the course repository into your account.

    You should see Your browser shows YOUR-NAME/beacon-yard with 'forked from ReimagineMedias/beacon-yard' under the title.

  2. Open your fork's Actions tab and enable workflows.

    You should see The Actions tab of your fork lists a workflow called ci in its left sidebar, and no banner says workflows are not running.

Open this step in lesson mode · Link to this step · This confused me

4Clone your fork

On your fork's page, click the green Code button, choose the HTTPS tab and copy the URL. Then, in a terminal:

text
cd ~/Code
git clone https://github.com/YOUR-NAME/beacon-yard.git
cd beacon-yard

Git downloads every file and the entire history into a new beacon-yard folder 2. Open that folder in VS Code. Inside is src/shared/Config.luau, the real version of the file you have been practising on.

Forking the game repository, copying the clone address and cloning it into Code. The transcript below lists every action.

Build along

m00-baseplate

  • Code/beacon-yard
  1. Clone your fork into Code, open it in VS Code, and run git log --oneline in the integrated terminal.

    You should see VS Code's Explorer shows the beacon-yard folder with src, tests, default.project.json and README.md, and git log --oneline in its terminal lists the game's commits.

Open this step in lesson mode · Link to this step · This confused me

5Let Git sign in to GitHub

Cloning a public repository needs no sign-in, but pushing does. GitHub does not accept your account password for Git 3. Instead, a helper signs you in through the browser once and remembers it 4.

Windows: Git Credential Manager. Already installed with Git for Windows. The first time you push, a browser window asks you to sign in to GitHub and authorise Git. After that, pushes just work.

macOS: GitHub CLI. Install the GitHub CLI from cli.github.com 5, then run gh auth login. Choose GitHub.com, then HTTPS, and answer Y when asked whether to authenticate Git with your GitHub credentials. Finish in the browser.

GitHub Desktop. Sign in inside the app, and it handles Git's credentials for itself 6.

git push asks for a username and password, and your GitHub password is rejected. Why?

  1. You typed it wrong
  2. GitHub no longer accepts account passwords for Git; sign in through a credential helper or the GitHub CLI instead
  3. Your fork is private
  4. Pushing needs GitHub Pro
Answer

GitHub no longer accepts account passwords for Git; sign in through a credential helper or the GitHub CLI instead. Password authentication for Git was removed. Git Credential Manager (Windows) or gh auth login (macOS) signs in through the browser and stores a token for you.

Open this step in lesson mode · Link to this step · This confused me

6origin and upstream

A clone remembers where it came from. Ask it:

text
git remote -v
text
origin  https://github.com/YOUR-NAME/beacon-yard.git (fetch)
origin  https://github.com/YOUR-NAME/beacon-yard.git (push)

origin is the conventional name for the remote you cloned from: your fork. It helps to add the course repository too, under the conventional name upstream, so you can fetch new lessons' changes later:

text
git remote add upstream https://github.com/ReimagineMedias/beacon-yard.git

You push to origin. You only ever pull from upstream.

Which remote do you push your branches to?

  1. upstream, the course repository
  2. origin, your fork
  3. Both at once
  4. Neither; GitHub pulls them automatically
Answer

origin, your fork. You can write to your own fork, origin. The course repository is upstream; you read from it, and you could only change it through a pull request the maintainers accept.

Open this step in lesson mode · Link to this step · This confused me

7Push a branch

Make a small, real change on a branch. Open src/shared/Config.luau, change COIN_RESPAWN_SECONDS from 4 to 3, save, and in the terminal:

text
git switch -c faster-coins
git commit -am "chore: respawn coins after 3 seconds"
git push -u origin faster-coins

Look at the message. Beacon Yard's checks read every commit message in a pull request, and a message must look like type: lowercase description, for example fix: stop coins respawning twice. This style is called Conventional Commits. The type is one of feat, fix, docs, style, refactor, perf, test, build, ci, chore or revert. The part after the colon starts with a lowercase letter and has no full stop at the end. chore fits a small tweak like this one. Practise your commit messages in this shape from now on.

-u tells Git to remember that your local faster-coins goes with origin's faster-coins, so next time a plain git push is enough. GitHub's reply includes a line starting remote: Create a pull request for 'faster-coins' on GitHub by visiting:, followed by a link.

Build along

m00-baseplate

  • src/shared/Config.luau
  1. Make the change, commit it on a new branch with the message above and push it to origin.

    You should see The push finishes, and your fork's page on GitHub shows a yellow banner: faster-coins had recent pushes.

Open this step in lesson mode · Link to this step · This confused me

8Open a pull request in your fork

Good place for a break. Your answers and progress are saved in this browser, so you can stop here and come back to this step. Tick what you can do now; if something is shaky, go back one step first.

Checkpoint

  • I have forked the course repository and cloned my fork
  • I am signed in, so git push to my fork works
  • I can say what origin and upstream are

A pull request is where a change gets reviewed before it reaches main. Professional teams merge almost nothing without one, even their own work.

Click Compare & pull request on the banner. Check the base before anything else. For a fork, GitHub suggests the course repository as the base. For practice, change base repository to YOUR-NAME/beacon-yard and base to main, so the pull request stays inside your fork 7.

Give it a title, and describe what changed and why in the box below. Then click Create pull request.

For practice, point the pull request at your own fork.

You are practising, and the pull request page shows base repository: ReimagineMedias/beacon-yard. What do you do?

  1. Create it anyway; the maintainers will merge it
  2. Change base repository to your fork, so the practice pull request stays in your own repository
  3. Delete your fork
  4. Change compare to main
Answer

Change base repository to your fork, so the practice pull request stays in your own repository. Practice pull requests belong in your fork. A pull request to the course repository asks its maintainers to accept the change for every learner.

Open this step in lesson mode · Link to this step · This confused me

9The inspector at the door

A few seconds after you open the pull request, a box near the bottom says Some checks haven't completed yet. These are Beacon Yard's continuous integrationContinuous integration (CI)Programs a server runs on every push to check the project still passes its tests.Think of it as an inspector who runs the same checklist on every delivery. (CI) checks: programs GitHub runs on a fresh Linux machine for every push.

Both sidesContinuous integration is an inspector at the workshop door.
In the pictureIn Roblox
A delivery arrivingA push or a pull request
The inspector's checklistThe CI jobs: format, lint, build and tests
A green stampEvery job exited with code 0

See the whole analogy cast

Think of an inspector standing at the workshop door. Nothing reaches main without passing them. They run the same list of checks every time, without getting tired or skipping one, and they write down exactly what failed.

Think of it as An inspector at the workshop door

Beacon Yard's list lives in a file in the repository:

jobs:
  commits:
    name: commit subjects
    runs-on: ubuntu-latest
    if: github.event_name == 'pull_request'
    steps:
      - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
        with:
          fetch-depth: 0
      - name: Validate pull request commit subjects
        run: node scripts/check-commit-range.mjs ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}
 
  format:
    name: format
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
      - uses: CompeyDev/setup-rokit@1d9390883f7ebce19d48f5b8d006e11d387c92ab # v0.2.1
        with:
          version: v1.2.0
      - name: stylua --check .
        run: stylua --check .
 
  lint:
    name: lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
      - uses: CompeyDev/setup-rokit@1d9390883f7ebce19d48f5b8d006e11d387c92ab # v0.2.1
        with:
          version: v1.2.0
      - name: selene src tests
        run: selene src tests
Figure 9.1

Each job is one check: commit subjects (pull requests only) checks that every commit message in the pull request has the type: lowercase description shape, format runs StyLua to confirm the house style, lint runs Selene on src, tests and unit, type check runs luau-lsp to verify Luau types, id guard fails if a real Roblox id has slipped into a file, challenge index checks that every challenge test and solution stays in sync, build checks that Rojo can build the game and test places, every milestone tag repeats checks across each tagged version, and actions pinned verifies the workflow's own dependencies. That makes nine jobs. A green tick means the command exited with 0; a red cross means it did not 8.

If nothing appears, open your fork's Actions tab. If it says workflows are not running on this fork, you missed the enable step after forking: click the button to enable them, then push again.

What does a green tick next to 'format' tell you?

  1. The game is fun
  2. The format command finished with exit code 0 on GitHub's machine for this commit
  3. A maintainer approved the pull request
  4. Your code has no bugs
Answer

The format command finished with exit code 0 on GitHub's machine for this commit. A check is a command, and green means it exited with 0. It says nothing about anything the command did not test.

Open this step in lesson mode · Link to this step · This confused me

10Read a failing check

Sooner or later a check fails. Clicking Details next to it opens the job's log, with every step listed; the failing one is expanded 9. Here is a real StyLua 2.1.0 failure, as the format check prints it:

text
Diff in src/shared/Config.luau:
1   1    | local Config = {
2   2    | 	ROUND_SECONDS = 40,
3        |-	COIN_VALUE=10,
    3    |+	COIN_VALUE = 10,
4   4    | }

It is a diff, just like git diff. The - line is what you wrote and the + line is what StyLua wants: spaces around =. Nothing is wrong with the game. The house style is simply enforced.

The job you are most likely to meet first is commit subjects. If a commit message in the pull request breaks the rule, its log lists each offending commit, for example:

text
Invalid commit subject: "Respawn coins after 3 seconds"
the subject must use type(scope)?: lowercase description.
Example: ci: check that every commit follows conventional commits

The fix is a better message, not different code. Reword the commit (git commit --amend -m "chore: respawn coins after 3 seconds" for the latest one) and push again; if you amended a commit you had already pushed, Git asks for git push --force-with-lease, which is fine on your own practice branch. Read a log from the first red line, not the last. Later errors are often knock-on effects of the first one.

Both sidesRemember: Continuous integration is an inspector at the workshop door.

Details opens the log. Start reading at the first red line.

The format check shows the diff above. Fix the line so the check passes.

local Config = {
	ROUND_SECONDS = 40,
	COIN_VALUE=10,
}
print(Config.COIN_VALUE)
Answer

Line 3: COIN_VALUE=10,. Fixed: COIN_VALUE = 10,. Match the + line exactly. Even better, run stylua on your computer before pushing; the setup lesson installs it.

Open this step in lesson mode · Link to this step · This confused me

11Where the inspector idea breaks

A real inspector might notice something odd that is not on the list. CI never does. It runs exactly the commands in ci.yml and nothing else.

Where does it break?“An inspector at the workshop door” is a good picture of continuous integration. Where does it stop being true?

It breaks here. The inspector only checks what is on the checklist, so a neatly formatted change that sets COIN_VALUE to 5000 still gets a green stamp.

The true model. CI runs commands on a fresh machine for every push and reports each command's exit code. A pass proves only what those commands test, so the project is only as safe as its tests.

You set COIN_VALUE = 5000, neatly formatted. Every check goes green. What does that prove?

  1. The economy is balanced
  2. Only that the files pass the automated checks (format, lint, types, id guard and build); no check tests whether 5000 coins is sensible
  3. CI tested the coin pads in a real game
  4. A maintainer reviewed it
Answer

Only that the files pass the automated checks (format, lint, types, id guard and build); no check tests whether 5000 coins is sensible. CI checks only what someone wrote an automated check for. Later modules add unit tests for game rules (and Studio playtests for live gameplay), and even then a human still reviews the change.

Open this step in lesson mode · Link to this step · This confused me

12Merge, then pull

When the checks are green, click Merge pull request and then Confirm merge. main in your fork on GitHub now has your commit, but main on your computer does not know yet. Bring it down:

text
git switch main
git pull

git pull fetches new commits from the remote and merges them into your current branch. Your local main now matches GitHub, with COIN_RESPAWN_SECONDS = 3.

Build along

m00-baseplate

  • src/shared/Config.luau
  1. Merge your pull request on GitHub, then switch to main and pull on your computer.

    You should see git log --oneline on main shows 'chore: respawn coins after 3 seconds' near the top.

Open this step in lesson mode · Link to this step · This confused me

13Keep your fork up to date

The course repository will gain fixes and new milestones over time. Your fork does not update itself. There are two ways to catch up:

  • On your fork's GitHub page, click Sync fork, then Update branch, and afterwards git pull on your computer 10.
  • From the terminal, with main checked out: git pull upstream main, then git push to update your fork on GitHub.

If you changed the same lines the course changed, you will get a merge conflict, and you already know how to resolve one.

Order the terminal route for catching up with the course repository.

  1. git push
  2. git switch main
  3. Resolve any conflicts and commit
  4. git pull upstream main
Answer

1. git switch main 2. git pull upstream main 3. Resolve any conflicts and commit 4. git push. Stand on main, bring in the course's commits, settle any conflicts, then update your fork on GitHub.

Open this step in lesson mode · Link to this step · This confused me

14Issues, and asking the course for help

An issueIssueA GitHub page for one problem, question or idea, with a discussion under it.Think of it as a numbered ticket on the notice board. is a GitHub page for one problem, question or idea, with a discussion under it 11. Every step of this course has a this confused me link. It opens a new issue on the course repository with the lesson and step already filled in, using GitHub's ability to prefill an issue from a link 12.

Those issues make the course better for everyone, so write them well:

  1. Search first. Someone may have asked already; add a comment there instead.
  2. Say what you expected and what actually happened, in a sentence each.
  3. Show what you tried, including commands and the exact error text, pasted as text in a code block, not as a photo.
  4. Say your system: Windows or macOS, and the version.
  5. Leave out anything personal: your real name, school, location, passwords, cookies and Roblox user ids.

The link fills in the lesson and step. You add what you expected, what happened and what you tried.

Which belong in a good 'this confused me' issue?

  1. The step, what you expected, and what happened
  2. The exact error text pasted in a code block
  3. A photo of your screen taken with your phone
  4. Your operating system and version
  5. Your Roblox password so someone can check your account
Answer

The step, what you expected, and what happened; The exact error text pasted in a code block; Your operating system and version. Text can be searched and copied, and a phone photo cannot. Never share passwords, cookies or codes: no helper needs them.

Open this step in lesson mode · Link to this step · This confused me

15Other ways to do the same things

Clone, push and open pull requests with...

OptionWhat it isWhen pros pick itTrade-offs
git and the websiteGit in the terminal for clone, commit and push; the website for forks, pull requests, checks and issues (what this lesson showed).The default for learning, because every step is visible.You switch between two places.
GitHub CLI (gh)A command that forks, clones, opens pull requests and shows CI results without leaving the terminal: gh repo fork ReimagineMedias/beacon-yard --clone, gh pr create, gh pr checks.You live in the terminal and want fewer browser trips.One more tool to install and sign in to.
GitHub DesktopClone, branch, commit, push and Create Pull Request with buttons; its pull request button opens the browser for the final step.You prefer buttons to commands.The same trade-offs as for plain Git: fewer commands, and you cannot paste one from a tutorial.
VS CodeThe Source Control view can push, pull and publish branches; GitHub's own extension adds pull requests inside the editor.You want pull requests next to the code you are editing.Needs the GitHub extension, and the website is still where checks and issues are easiest to read.

Sources: 5 6

You push with GitHub Desktop, and your teammate opens the pull request with gh pr create. Does that cause a problem?

  1. Yes; Desktop and the CLI keep separate histories
  2. No; they are different front ends to the same Git repository and the same GitHub pull requests
  3. Only if you are on Windows
  4. Only for private repositories
Answer

No; they are different front ends to the same Git repository and the same GitHub pull requests. Every tool talks to the same repository and the same GitHub API. Choose by comfort.

Open this step in lesson mode · Link to this step · This confused me

16Challenges

Level 2, Builder

Challenge

Send a small change through your fork the way a team would, and wait for the checks.

Start from
Your fork and clone, with main up to date.

Done means

  • A pull request inside your fork changes one value in Config.luau.
  • Its commit message follows type: lowercase description, such as chore: respawn coins after 3 seconds.
  • Its description says what changed and why in at least two sentences.
  • Every CI check on it is green, including commit subjects, and it is merged into your fork's main.

Hints

  1. If nothing runs, check your fork's Actions tab.
  2. Keep the change small: one value, one commit.
  3. If commit subjects is red, reword the commit as type: lowercase description.

Level 2, Builder

Challenge

Break the format check on purpose, then read the log to find out why it failed and fix it.

Start from
A new branch in your clone.

Done means

  • You push a commit that makes the format check fail on purpose (for example, remove the spaces around one =), with a message like test: break the format check.
  • You open the failing job's log and find the diff that explains the failure.
  • You push a fix with a message like fix: restore spaces around the equals sign, and the same pull request turns green without being closed and reopened.

Hints

  1. Pushing more commits to a branch updates its open pull request automatically.
  2. The log's + line is what StyLua expects.
  3. Both commit messages need the type: lowercase description shape, because commit subjects checks every commit in the pull request.

Open this step in lesson mode · Link to this step · This confused me

17Recap

Recap

  1. Fork once on GitHub, clone your fork once, then branch, commit and git push -u origin to send work up. origin is your fork; upstream is the course, which you only pull from.
  2. Open practice pull requests inside your fork: check the base repository first. CI checks are commands; green means exit code 0, and a failing log is read from its first red line.
  3. Keep your fork current with Sync fork or git pull upstream main. Ask for help with a searchable issue: expected, actual, what you tried, your system, nothing personal.

Continuous integration is an inspector at the workshop door, until the inspector only checks what is on the checklist, so a neatly formatted change that sets COIN_VALUE to 5000 still gets a green stamp.

Next Programming from zero, part 1: values and variables

Open this step in lesson mode · Link to this step · This confused me