.gitignore for Packer

4 ignore rules for Packer, ready to copy into your repository.

Tool for creating machine images

The complete .gitignore for Packer

# Generated by LFGitignore - https://lfgitignore.com
# Created: 2026-08-05 02:27:10 UTC
# Technologies: Packer

### Packer ###
packer_cache/
*.pkrvars.hcl
crash.log
*.box

What these Packer rules actually ignore

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

Cache objects

Pattern What it ignores
packer_cache/ Cache objects

Crash log

Pattern What it ignores
*.pkrvars.hcl https://www.packer.io/guides/hcl/variables Exclude all .pkrvars.hcl files, which are likely to contain sensitive data, such as password, private keys, and other secrets. These should not be part of version control as they are data points which are potentially sensitive and subject to change depending on the environment.

Crash Log

Pattern What it ignores
crash.log Crash Log

For built boxes

Pattern What it ignores
*.box For built boxes

How to use this .gitignore for Packer

  1. Copy the Packer 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 DevOps .gitignore templates

See every DevOps template