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.
- Drop area. Drop files or a whole folder here. Folders keep their structure: dropping
dessertsaddsdesserts/leche-flan.mdand the rest. - Files to add. What this upload will commit. The ✕ takes a file off the list before you commit, if you dropped one by mistake.
- 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”.
- Where the commit goes. Straight onto the branch you’re on, or onto a new branch with a pull request (step 2).
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:
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):
| Where | Limit |
|---|---|
| Uploading in the browser | 25 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 project | Git LFS (lesson 7.5) |
| Attachments in issues and comments | 10 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
Twelve recipe files, 3 KB each
A 4 MB photo of Lola Remy’s handwritten page
A 60 MB scan of the whole notebook, as a PDF
Three hundred photos for a cookbook layout
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
adobo.md, a recipeLICENSE, CC BY 4.0.env, holding the password for the family’s email listlola-phone-numbers.txt__pycache__/, made by running the Python script.gitignore.DS_StoreorThumbs.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
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
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.
- GitHub Docs: Adding a file to a repository: uploading in the browser: 25 MiB per file, up to 100 files at a time
- GitHub Docs: About large files on GitHub: the 50 MiB warning and the 100 MiB limit for pushed files
- GitHub Docs: Attaching files: pictures and files in issues, pull requests and comments
- GitHub Docs: Basic writing and formatting syntax: images in Markdown, with alt text and relative paths
- Git documentation: gitignore: keeping files out of every commit