How to add a video to a GitHub pull request
Drag an MP4, MOV or WebM into the description and GitHub plays it inline. Size limits on free and paid plans, fixes for big files, and how to automate it.
A screenshot shows a screen. A video shows that the flow works. For a pull request that changes anything a user can see, a short video in the description saves the reviewer from checking out the branch, and saves you from a "can you show me?" meeting.
GitHub supports video in pull requests natively. No plugin, no link to a third-party host. Here is how it works, the limits that trip people up, and how to make it a habit instead of a chore.
The short version
- Record the change (a screen recording of the browser, the simulator or the emulator).
- Make sure the file is MP4, MOV or WebM, and under the size limit for your plan.
- Drag it into the pull request description or a comment, or paste it, or click the attach button below the text box.
- GitHub uploads it and inserts a link. When you save, the link renders as a video player.
That is all. The rest of this guide is about doing it well.
Formats and size limits
GitHub's documentation on attaching files lists the rules:
- Formats:
.mp4,.movand.webm. GitHub recommends H.264 for the best compatibility. - Size: up to 10 MB for videos in repositories on a free plan, up to 100 MB in repositories owned by a user or an organization on a paid plan.
- Images and GIFs: 10 MB.
The 10 MB limit is the one you will hit. A one-minute screen recording straight out of QuickTime is often several times that.
When the file is too big
Two options: make it smaller, or make it shorter.
Smaller. Re-encode it to H.264 at 720p with a target bitrate. For a minute or two of screen recording, 720p at a few hundred kilobits per second keeps text readable and lands under 10 MB. We wrote the exact ffmpeg commands, and the arithmetic behind them, in How to compress a screen recording under 10 MB.
Shorter. Most pull request videos are too long anyway. Open on the screen where the change is visible, show the one gesture that proves it, say what is left. Thirty seconds covers most changes. More in How long should a demo video be?.
Why your video does not play
A few common causes:
- The codec, not the extension. A
.movrecorded in HEVC (H.265), which is the default on recent Macs and iPhones, may not play in every browser. Re-encode to H.264 in an MP4 container and it plays everywhere. - A format GitHub does not accept.
.mkvand.aviare refused. Convert them first. - The upload did not finish. Wait until the placeholder text in the box turns into a link before saving.
Where to put the video
At the top of the description, under a heading such as "Demo". The reviewer sees it before the list of changed files. If the pull request has a template, add the heading there so every author fills it:
## Demo
<!-- Drag a video here: what changed, the gesture that proves it, what is left. -->
## What changed
## How to test
GitHub picks up a template from .github/pull_request_template.md in the repository.
In a comment, after a change. When a review asks for changes and you push a fix, a short video of the fixed behavior in a reply is clearer than "done, please re-review".
Before and after, for a visual fix. Two short clips, one from the base branch and one from yours, side by side in a table. For a layout or animation fix, nothing explains it faster.
Make the video worth watching
A pull request video is not a product launch. It needs three things:
- The change, immediately. Navigation happens before you hit record.
- The proof. The saved state, the new row, the message sent.
- What is left. One sentence, spoken or in the description under the video.
Use demo data. Never film production: real names and emails in a video attached to a pull request stay in the repository's history for as long as the pull request exists. We explain how to set up demo data in Demo data, not production.
Narration helps a lot more than people expect. A silent recording shows clicks. A voice explains why the click matters. If you would rather not record your own voice, write the line and generate it.
Automating it
Recording a video by hand for every pull request works for a week. Then the team gets busy and the videos stop. Two things make automation tricky on GitHub:
- There is no public API to attach a file to a pull request comment. The drag-and-drop upload is a browser feature. A bot that wants to share a video posts a link instead, or uploads the file somewhere else first.
- Someone has to run the app. A video of a web app needs the app running, with demo data, at the right commit.
This is the problem Pullscene solves. It watches the repositories you connect. When a pull request is merged, or when you ask, it reads the diff, the commits and the linked ticket, writes a script, rehearses every gesture against your app running on your Mac, records it with a voice, and posts a comment on the pull request with a link to the video. The link plays without an account, split into scenes with the script next to it. The file is also there to download, with a version under 10 MB when the original is bigger.
Frequently asked questions
Can you embed a video in a GitHub pull request?
Yes. Drag an MP4, MOV or WebM file into the description or a comment, or use the attach button. GitHub uploads it and renders an inline player when you save.
What is the maximum video size on GitHub?
10 MB for videos in repositories on a free plan, and 100 MB in repositories owned by a user or an organization on a paid plan, according to GitHub's documentation on attaching files.
Why is my video not playing on GitHub?
Usually the codec. A MOV in HEVC may not play in every browser. Re-encode to H.264 in an MP4 container. Also check that the format is MP4, MOV or WebM and that the upload finished before saving.
Can a bot post a video in a GitHub pull request?
A bot can post a comment, but GitHub's public API has no endpoint to attach a file to it. Bots post a link to the video hosted elsewhere, which is what most automation tools, ours included, do.
Is a GIF better than a video in a pull request?
A GIF autoplays and needs no click, but it has no sound, its colors are limited and it is often larger than an MP4 of the same clip. For anything over a few seconds, or anything with narration, use a video.