# GitHub

> Keep a copy of your code online, see how it changed over time, and review proposed edits before adding them to the project.

Web page: https://buildladder.com/tools/github

Imagine a friend wants to improve the instructions for running your app. On GitHub, the project lives in a repository, a folder with a history of saved changes. Your friend can propose an edit in a pull request for you to read.

Try changing one sentence in a separate branch, a working copy of the project’s history. Open a pull request and compare the old and new wording. Merging it adds the approved edit to the shared version.

- Made by: GitHub
- Official site: https://github.com
- Cost: Free plan with unlimited public and private repositories, which are code folders with their history. Team is $4 per person a month, as of November 2026.
- What you need first: An email address to make an account.
- Who it helps: When your product has more than a few files. Most hosts can put your site online straight from GitHub.
- Updated: 2026-11-10

## Save your code on GitHub

Put your product on GitHub so a copy lives online. Then change things on a branch, open a pull request, get a review and merge it into main.

What you’ll end up with: Your product is in a private GitHub repository. You know how to change it safely on a branch and merge it into main.

### You’ll need

- A website or app in a folder on your computer.
- Your AI tool, set up and working in that folder.
- GitHub account (https://github.com/signup): The free plan has unlimited public and private repositories and unlimited collaborators, as of November 2026

### Your part

- Make your GitHub account and sign in.
- Create the repository and choose Private.
- Read the review of each change, then press the merge button.

### Step 1 of 7: Create a private repository

This step is mine to do. Walk me through it, one action at a time:
- Go to github.com and sign in. If you don’t have an account, go to github.com/signup and follow the prompts. You’ll be asked to check your email.
- In the upper-right corner, click the plus icon, then New repository.
- Check that Owner shows your own username, not an organization.
- Type a Repository name, like my-site. Use letters, numbers, dashes and dots.
- Choose Private.
- Leave the README, .gitignore and license options off. Your product already has files, and an empty repository takes them without a clash.
- Click Create repository.

It worked when: GitHub shows your empty private repository, with a Quick Setup box that holds its address.

Keep for later: The address in Quick Setup that ends in .git, for “Upload your code with your AI tool”.

If something goes wrong:
- It says the name is already taken. You already have a repository with that name. Pick another name, or open the one you have.
- You already ticked README and created the repository. That’s fine. Tell your AI tool before it uploads, so it gets the README first.

### Step 2 of 7: Upload your code with your AI tool

I made an empty private repository on GitHub for this product. Ask me for its address, the one that ends in .git.

Then, following GitHub’s current docs:
1. Check that .env and any other files with keys are listed in .gitignore. Show me file names only, never key values.
2. If Git isn’t set up in this folder, set it up with main as the branch name. Save a first version (a commit) with a short note.
3. Connect this folder to my repository under the name origin.
4. Push main to origin.

If GitHub needs me to sign in, set up GitHub CLI and run gh auth login, so I can sign in through my browser. Let me do the sign-in myself.

Explain each step in plain words before you run it.

It worked when: Your product’s files show on your repository page on github.com.

Before we move on, check with me:
- Is .env missing from the file list, as it should be?

If something goes wrong:
- The push is rejected. The repository may already have a README. Tell your AI tool: “The push was rejected. Get what’s on GitHub first, then push again. Don’t force it.”
- Git asks for a username and password. Tell your AI tool: “Set up GitHub CLI and run gh auth login, so I can sign in through my browser.”
- You can see .env on GitHub. Make new keys at each service now, because anyone who can see the repository can read the old ones. Then ask your AI tool to remove .env and add it to .gitignore.

### Step 3 of 7: Count your private work on the Leaderboard

This step is optional. Ask me whether I want it, and skip it if I don’t.

This step is mine to do. Walk me through it, one action at a time:
- On GitHub, click your profile picture, then Your profile.
- Above the contribution calendar, click Contribution settings.
- Turn on Private contributions if it’s off.

It worked when: Private contributions is turned on in Contribution settings on your GitHub profile.

### Step 4 of 7: Make a change on a branch

I want to try a change without touching main. The change: a small fix or feature you can see, like a new line of text on the home page.

1. Make a new branch with a short name that says what the change is.
2. Make the change on that branch, and show me how to see it on my computer.
3. When I say it works, save it as a commit with a short note.
4. Push the branch to origin.

Tell me the branch name when you’re done. Don’t merge anything into main.

It worked when: The branch menu on your repository page lists a new branch with your change, and main is unchanged.

If something goes wrong:
- The change went straight onto main. Tell your AI tool: “That went onto main. Move the change to a new branch, and put main back how it was.” Do this before you push.

### Step 5 of 7: Open a pull request

This step is mine to do. Walk me through it, one action at a time:
- On GitHub, go to the main page of your repository.
- In the yellow banner above the file list, click Compare & pull request. If there’s no banner, choose your branch in the branch menu first.
- Check that base is main and compare is your new branch.
- Type a title that says what changed, and a short description of why.
- Click Create pull request.

It worked when: You see a pull request page with your title and a Files changed tab.

Before we move on, check with me:
- Open Files changed. Do you see only the change you asked for?

If something goes wrong:
- Files changed shows things you didn’t ask for. Tell your AI tool: “The pull request has changes I didn’t ask for. Explain each one, and undo the ones we don’t need on this branch.”

### Step 6 of 7: Get the change reviewed

Review the changes on my branch compared with main, like a careful reviewer would.

List anything that could:
- break something that works now
- leak a key or private data
- fail for some visitors, like on a phone or with no internet
- be simpler

Sort them from most to least serious, and explain each one in plain words. Don’t change anything yet. Then ask me which ones to fix. Commit and push each fix to the same branch.

It worked when: Your AI tool lists problems, most serious first, or says that nothing needs fixing.

Before we move on, check with me:
- Do you understand each problem in the list?
- Are the fixes you chose now in the pull request?

If something goes wrong:
- The review lists something you don’t understand. Ask your AI tool: “Explain that problem as if I’ve never coded. What could go wrong for a visitor?”

### Step 7 of 7: Merge it into main

This step is mine to do. Walk me through it, one action at a time:
- Under your repository name, click Pull requests, then open yours.
- Scroll to the bottom and click Merge pull request.
- Click Confirm merge.
- GitHub offers to delete the branch. You can, because its change is now in main.
- Tell your AI tool: “I merged the pull request. Switch to main and get the latest version from origin.”

It worked when: The pull request shows as merged, and main on GitHub has your change.

Before we move on, check with me:
- Did your AI tool say it switched to main?

If something goes wrong:
- You can’t click Merge pull request, because of conflicts. Main changed in the same lines since you made the branch. Tell your AI tool: “My pull request has conflicts. Bring main into my branch, show me each clash, and fix it with me.”

Compare GitHub with the other options: https://buildladder.com/concepts/saving-your-code.md
