.gitignore for Archives

28 ignore rules for Archives, ready to copy into your repository.

Compressed archive files

The complete .gitignore for Archives

# Generated by LFGitignore - https://lfgitignore.com
# Created: 2026-08-05 01:30:05 UTC
# Technologies: Archives

### Archives ###
# 7-Zip archive
*.7z
# Java archive
*.jar
# RAR archive
*.rar
# Gzip compressed file
*.gz
*.gzip
# ZIP archive
*.zip
*.bzip
*.tgz
*.bzip2
*.bz2
*.xz
*.lzma
# Windows cabinet archive
*.cab
*.xar
*.zst
*.tzst
# ISO disk image
*.iso
# Tape archive
*.tar
# macOS disk image
*.dmg
*.xpi
# Ruby gem package
*.gem
# Python egg package
*.egg
*.deb
*.rpm
# Windows installer package
*.msi
# Windows merge module
*.msm
# Windows patch file
*.msp
*.txz

What these Archives rules actually ignore

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

General

Pattern What it ignores
*.7z 7-Zip archive
*.jar Java archive
*.rar RAR archive
*.gz Gzip compressed file
*.gzip General
*.zip ZIP archive
*.bzip General
*.tgz General
*.bzip2 General
*.bz2 General
*.xz General
*.lzma General
*.cab Windows cabinet archive
*.xar General
*.zst General
*.tzst General

Packing-only formats

Pattern What it ignores
*.iso ISO disk image
*.tar Tape archive

Package management formats

Pattern What it ignores
*.dmg macOS disk image
*.xpi Package management formats
*.gem Ruby gem package
*.egg Python egg package
*.deb Package management formats
*.rpm Package management formats
*.msi Windows installer package
*.msm Windows merge module
*.msp Windows patch file
*.txz Package management formats

How to use this .gitignore for Archives

  1. Copy the Archives 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.

Other Utility .gitignore templates

See every Utility template