.gitignore for GitHub Pages

6 ignore rules for GitHub Pages, ready to copy into your repository.

Static site hosting service

The complete .gitignore for GitHub Pages

# Generated by LFGitignore - https://lfgitignore.com
# Created: 2026-02-09 07:29:55 UTC
# Technologies: GitHub Pages

### GitHub Pages ###
# Jekyll site output
_site/
# Sass cache directory
.sass-cache/
# Jekyll cache
.jekyll-cache/
# Jekyll metadata
.jekyll-metadata
/vendor
Gemfile.lock

What these GitHub Pages rules actually ignore

Every pattern below, and why it belongs in your .gitignore.

Basic Jekyll gitignores (synchronize to Jekyll.gitignore)

Pattern What it ignores
_site/ Jekyll site output
.sass-cache/ Sass cache directory
.jekyll-cache/ Jekyll cache
.jekyll-metadata Jekyll metadata

Additional Ruby/bundler ignore for when you run: bundle install

Pattern What it ignores
/vendor Additional Ruby/bundler ignore for when you run: bundle install

Details at https://github.com/github/pages-gem/issues/768

Pattern What it ignores
Gemfile.lock Details at https://github.com/github/pages-gem/issues/768

How to use this .gitignore for GitHub Pages

  1. Copy the GitHub Pages rules above, or download the file directly.
  2. Create a file named .gitignore at the root of your Git repository and paste the rules into it.
  3. If some of those files are already tracked, run git rm -r --cached . then commit again — Git only applies ignore rules to untracked files.
  4. Commit the .gitignore so everyone on the team shares the same rules.