Your repository on GitHub · lesson 3 of 9
Commands and ideas in this lesson
AAdd file › Upload filesone commit per upload
BAttaching a filepictures in issues and comments
C25 MiB, 100 files, 100 MiBGitHub's limits
D![alt text](path)a picture in Markdown

Uploading files

Last updated

Ana has twenty typed-up recipes, photos of Lola Remy's handwritten pages, and a LICENSE file to add to Kusina, and no terminal on her school computer. In this lesson you'll upload files and whole folders on GitHub, put them in the right folder or on a branch, replace a file, add pictures to a README and to an issue, and learn the limits, and what should never be uploaded at all.

By the end of this lesson you can

  • Upload files and folders on GitHub, each upload as one commit with a good message
  • Upload into a folder, onto a new branch, or over an existing file
  • Know GitHub's size limits, and choose between the browser, a push, Git LFS or somewhere else
  • Keep passwords, private files and generated files out of uploads

The upload page

In a repository, Add file › Upload files opens the upload page. Drag files or whole folders onto it, or click choose your files.

  1. Drop area. Drop files or a whole folder here. Folders keep their structure: dropping desserts adds desserts/leche-flan.md and the rest.
  2. Files to add. What this upload will commit. The ✕ takes a file off the list before you commit, if you dropped one by mistake.
  3. Commit message. Every upload is one commit, however many files it holds. Write a message as in lesson 1.7, not GitHub’s suggested “Add files via upload”.
  4. Where the commit goes. Straight onto the branch you’re on, or onto a new branch with a pull request (step 2).
GitHub’s upload page. 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.

Uploading files that belong together in one go makes one tidy commit: "Add three of Lola Remy's recipes". Uploading unrelated things separately keeps each commit about one thing.

Into a folder, onto a branch, over a file

Into a folder. Files go into the folder you're looking at. To put photos in photos/, open that folder first, then Add file › Upload files. To make a new folder, drop a folder from your computer, or create a file with a / in its name (lesson 4.4).

Onto a branch. Choose a branch in the branch menu before uploading, or pick Create a new branch in the commit form. The second also starts a pull request (lesson 5.2), so someone can check the files before they reach main. That's the right choice when you're adding to someone else's work.

Over a file. Uploading a file with the same name, into the same folder, replaces it. The commit's diff shows exactly what changed, and the old version is still in the history (lesson 4.1), so nothing is lost.

Removing a file. Open it and choose Delete file from its … menu. That's a commit too, and the file stays in the history.

Pictures in the README, and in issues

In the repository. Upload the picture like any file, say photos/lola-adobo-page.jpg, then show it in a Markdown file with its path, relative to that file:

![Lola Remy's handwritten adobo recipe, page 2 of her notebook](photos/lola-adobo-page.jpg)

The text in square brackets is the alt text: what someone using a screen reader hears, and what shows if the picture can't load. Describe what the picture shows.

In an issue, a pull request or a comment. Drag a picture into the text box, or paste it. GitHub uploads it straight away and writes the Markdown for you. These attachments aren't files in the repository: they belong to the conversation, and they're limited to 10 MB for images and 25 MB for most other files.

Photos from a phone often carry hidden details, such as where they were taken (Simple Digital Citizenship covers this). Check before uploading photos of people or homes to a public repository.

How big is too big?

GitHub's limits, from its documentation (checked 5 December 2026):

WhereLimit
Uploading in the browser25 MiB per file, up to 100 files at a time
Pushing from your computer (lesson 4.8)Git warns above 50 MiB; GitHub refuses files over 100 MiB
Bigger files that belong with the projectGit LFS (lesson 7.5)
Attachments in issues and comments10 MB for images, 25 MB for most other files

Git keeps every version of every file. A 20 MB photo replaced five times is 100 MB in the history, even though only one copy shows. Text files, like recipes, change cheaply; big pictures, videos and zip files don't, and GitHub can't show a line-by-line diff for them.

0 of 5 placed right

  1. Twelve recipe files, 3 KB each

  2. A 4 MB photo of Lola Remy’s handwritten page

  3. A 60 MB scan of the whole notebook, as a PDF

  4. Three hundred photos for a cookbook layout

  5. A 2 GB video of Lola cooking

Upload it, or don't?

Ana is about to drag her whole kusina folder onto the upload page. What should go in a public repository?

0 of 7 placed right

  1. adobo.md, a recipe

  2. LICENSE, CC BY 4.0

  3. .env, holding the password for the family’s email list

  4. lola-phone-numbers.txt

  5. __pycache__/, made by running the Python script

  6. .gitignore

  7. .DS_Store or Thumbs.db, made by the computer’s file browser

Whatever is on the upload's list of files goes into the commit, hidden files included. Read the list before pressing Commit.

Spot the trap: a password in the folder

Spot the trapAna

Ana drags her whole kusina folder onto the upload page. It still has a hidden .env file from a script that emails the family. The upload works, and the repository is public.

What happens if…

Check what you learned

Ana uploads five recipes in one go. How many commits does that make?
Ana uploads adobo.md into the folder where an adobo.md already is. What happens?
A file is 40 MiB. Can it be uploaded in the browser?

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