Your repository on GitHub · lesson 4 of 9
Commands and ideas in this lesson
AEdit (the pencil)change a file and commit, on the website
BBranch menuswitch, or type a name to make one
CReleasea tag, with notes, on GitHub
Dgit tagfrom lesson 3.6

Editing and branching in the browser

Last updated

Lola Remy spots a mistake in the adobo, and Ana is on her phone. She can fix it on GitHub without a computer. In this lesson you'll edit and commit on the website, make and compare branches there, and publish a release. Every button makes the same Git commits and branches you made in Stages 1 to 3.

By the end of this lesson you can

  • Create and edit files on GitHub, and commit with a good message
  • Make, switch, compare and delete branches on the website
  • Publish a release: a tag with notes

Edit and commit

Open a file and press the pencil (lesson 4.1, step 5). The file opens in an editor with Edit and Preview tabs. Make the change, then press Commit changes…:

  1. Your change. What you changed, as a diff: red for the old line, green for the new.
  2. Message. The commit message, with an optional longer description: the same as the subject and body in lesson 1.7.
  3. Which branch. Straight onto the branch you’re on, or onto a new branch, ready for a pull request (Stage 5).
  4. Commit changes. Makes one commit on GitHub. Your computer’s copy doesn’t have it until you pull (lesson 4.6).
GitHub’s commit form, after editing adobo.md. The course’s own drawing of this GitHub screen, with GitHub’s names for each part. A screenshot from the course’s demo account will replace it.

Add file › Create new file works the same way. Typing a / in the file name makes a folder: desserts/turon.md. Files can also be renamed (edit the name) and deleted (the … menu), each as a commit.

GitHub suggests a message such as "Update adobo.md". It names the file, not the change. Rewrite these three, made on GitHub from Ana's phone:

  1. GitHub suggested: Update adobo.md

    What the commit really did: Changed the salt from 1 tsp to 2 tsp, as Lola Remy says.

    0/50
  2. GitHub suggested: Create turon.md

    What the commit really did: Added Lola Remy’s turon recipe in a new desserts folder.

    0/50
  3. GitHub suggested: Delete notes.txt

    What the commit really did: Removed a file of old shopping notes that was uploaded by mistake.

    0/50

For bigger edits, pressing . on a repository page opens github.dev, a fuller editor in the browser that can change several files in one commit.

Branches on the website

The branch menu (the button saying main) lists the branches. To make one, type a new name into its search box and choose Create branch: desserts from main.

  1. Search box. Type to find a branch, or a new name to make one.
  2. Branches. Every branch on GitHub. The tick is the one you’re looking at; default is the one people see first, usually main.
  3. Create branch. Makes the branch at main’s newest commit, like git branch desserts (lesson 3.2). It exists on GitHub only until you fetch it.
  4. View all branches. The branches page: when each was last changed, and a bin to delete one. A deleted branch can be restored from there for a while.
GitHub’s branch menu, making a new branch. The course’s own drawing of this GitHub screen, with GitHub’s names for each part. A screenshot from the course’s demo account will replace it.

With desserts chosen in the menu, the files shown and every edit you commit belong to that branch. main doesn't change until the branch is merged, which on GitHub is done with a pull request (lesson 5.2).

Comparing branches

To see what a branch has that main doesn't, add /compare to the repository's address, or open Pull requests › New pull request, and choose the two branches. GitHub shows the commits and the diff between them, the same as git log main..desserts and git diff main...desserts would.

Seeing a comparison doesn't change anything. Turning it into a pull request is Stage 5.

Releases

A release is GitHub's page for a version: a tag (lesson 3.6) plus notes written in Markdown, and optional files to download. Releases › Draft a new release lets you pick or make a tag, write the notes, and publish. Generate release notes writes a first draft from the merged pull requests.

Screenshot of the releases page of cli/cli, the GitHub CLI, with numbered callouts. The numbered list below describes each part.
  1. Version and Latest. The release’s title. Latest marks the newest.
  2. Tag and commit. The tag this release is made from, and its commit’s short hash.
  3. Immutable. This release has been locked, so its tag and files can’t be changed after publishing.
  4. Notes. What changed, grouped into features, fixes and other changes, each linked to its pull request.
  5. Tags. Every tag in the repository, with or without a release.
A releases page on GitHub (the GitHub CLI’s). Screenshot of github.com, captured on 5 December 2026, signed out. GitHub changes its pages often, so yours may look a little different; the names in the list stay the same.

Kusina's first release, at the end of the capstone, will be v1.0: twenty recipes, with notes saying which ones.

Spot the trap: the default message

Spot the trapAna

Ana fixes eleven typos over a week, each from her phone. GitHub fills in “Update adobo.md”, “Update sinigang.md”, “Update adobo.md”… and she presses Commit each time.

What happens if…

Check what you learned

Ana edits adobo.md on GitHub and commits. What does her laptop’s Kusina have?
On GitHub, how do you make a branch called desserts?
What is a GitHub release made from?

Sources

Every command on this page behaves as these pages describe, and the sandbox prints what Git 2.55 prints. Hosting features (pull requests, protected branches) come from the host’s own documentation.

All sources for Simple Git