Lesson 41 +10 XP

Edit Code on GitHub

Edit Code on GitHub

You can make simple edits right on the GitHub website, no terminal needed.

Edit a file online

  1. Open a file in the repository.
  2. Click the pencil icon (Edit this file).
  3. Make your changes in the editor.
  4. Scroll down and write a commit message.
  5. Choose to commit directly to the branch, or "Create a new branch and start a pull request".

Why edit on GitHub?

  • Perfect for small fixes like typos in documentation.
  • Useful when you are not on your own computer.
  • GitHub creates the commit for you.

Commit options

You can:

  • Commit the change to the current branch.
  • Create a new branch and open a pull request (best for changes to someone else's repo).

The safest option

If the repository is not yours, always choose create a new branch and start a pull request. That way the owner can review your change before merging.

TL;DR

  • GitHub lets you edit files directly in the browser.
  • Small fixes like typos are quick to do online.
  • Write a commit message and choose where to commit.
  • For other people's repos, start a pull request.