.gitignore for Jenkins

10 ignore rules for Jenkins, ready to copy into your repository.

Automation server

The complete .gitignore for Jenkins

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

### Jenkins ###
/*
!/jobs
!/.gitignore
!/*.xml
jobs/**
!jobs/**/
builds
indexing
!config.xml
jobs/**/*workspace

What these Jenkins rules actually ignore

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

General

Pattern What it ignores
/* Ignore all JENKINS_HOME except jobs directory, root xml config, and .gitignore file.
!/jobs General
!/.gitignore General
!/*.xml General

Note: git doesn't track folders, only file content.

Pattern What it ignores
jobs/** Note: git doesn't track folders, only file content.
!jobs/**/ Note: git doesn't track folders, only file content.
builds For performance reasons, we want to ignore builds in Jenkins jobs because it contains many tiny files on large installations. This can impact git performance when running even basic commands like 'git status'.
indexing Note: git doesn't track folders, only file content.

Exclude only config.xml files in repository subdirectories.

Pattern What it ignores
!config.xml Exclude only config.xml files in repository subdirectories.

Don't track workspaces (when users build on the master).

Pattern What it ignores
jobs/**/*workspace Don't track workspaces (when users build on the master).

How to use this .gitignore for Jenkins

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