JGit configuration options

Legend

git optiondescription
option defined by native git
jgit custom option not supported by native git

For details on native git options see also the official git config documentation.

commitGraph options

optiondefaultgit optiondescription
commitGraph.readChangedPathsfalseWhether to use the changed-path Bloom filters in the commit-graph file (if it exists, and they are present).

core options

optiondefaultgit optiondescription
core.attributesFileIn addition to .gitattributes (per-directory) and .git/info/attributes, Git looks into this file for attributes . Path expansions are made the same way as for core.excludesFile.
core.autocrlffalseSetting this variable to true is the same as setting the text attribute to auto on all files and core.eol to crlf. Set to true if you want to have CRLF line endings in your working directory and the repository has LF line endings. This variable can be set to input, in which case no output conversion is performed.
core.bareset automatically on init or cloneIf true this repository is assumed to be bare and has no working directory associated with it. If this is the case a number of commands that require a working directory will be disabled
core.bigFileThreshold50 MiBFiles larger than this size are stored deflated, without attempting delta compression. Storing large files without delta compression avoids excessive memory usage, at the slight expense of increased disk usage. Additionally files larger than this size are always treated as binary.
core.checkstatWhen missing or is set to default, many fields in the stat structure are checked to detect if a file has been modified since Git looked at it. Checks as much of the dircache stat info as possible (in JGit limited by Java filesystem API). When set to minimum only checks the size and whole second part of time stamp when comparing the stat info in the dircache with actual file stat info.
core.commitGraphfalseWhether to read the commit-graph file (if it exists) to parse the graph structure of commits.
core.compression-1 (zlib default)An integer -1..9, indicating a default compression level. -1 is the zlib default. 0 means no compression, and 1..9 are various speed/size tradeoffs, 9 being slowest.
core.deltaBaseCacheLimit10 MiBMaximum number of bytes to reserve for caching base objects that multiple deltafied objects reference. By storing the entire decompressed base object in a cache Git is able to avoid unpacking and decompressing frequently used base objects multiple times.
core.dfs.blockLimit30 MiBMaximum number bytes of heap memory to dedicate to caching pack file data in DFS block cache.
core.dfs.blockSize64 kiBSize in bytes of a single window read in from the pack file into the DFS block cache.
core.dfs.concurrencyLevel32The estimated number of threads concurrently accessing the DFS block cache.
core.dfs.deltaBaseCacheLimit10 MiBMaximum number of bytes to hold in per-reader DFS delta base cache.
core.dfs.streamFileThreshold50 MiBThe size threshold beyond which objects must be streamed.
core.dfs.streamBufferBlock size of the packNumber of bytes to use for buffering when streaming a pack file during copying. If 0 the block size of the pack is used
core.dfs.streamRatio0.30Ratio of DFS block cache to occupy with a copied pack. Values between 0 and 1.0.
core.dirNoGitLinksfalseIf set to true avoid checking for submodules. See bug 436200.
core.eolnativeSets the line ending type to use in the working directory for files that are marked as text (either by having the text attribute set, or by having text=auto and Git auto-detecting the contents as text). Alternatives are lf, crlf and native, which uses the platform’s native line ending.
core.excludesFileSpecifies the pathname to the file that contains patterns to describe paths that are not meant to be tracked, in addition to .gitignore (per-directory) and .git/info/exclude.
core.fileModeAuto detects if file modes are supportedTells Git if the executable bit of files in the working tree is to be honored.
core.hideDotFilesdotGitOnlyWindows only. If true, mark newly-created directories and files whose name starts with a dot as hidden. If dotGitOnly, only the .git/ directory is hidden, but no other files starting with a dot.
core.hooksPath$GIT_DIR/hooksPath to look for hooks.
core.logAllRefUpdatestrue in a repository with working tree, false in bare repositoryEnable the reflog.
core.packedGitLimit10 MiBMaximum number of bytes to cache in memory from pack files.
core.packedGitMmapfalseWhether to use Java NIO virtual memory mapping for JGit buffer cache. When set to true enables use of Java NIO virtual memory mapping for cache windows, false reads entire window into a byte[] with standard read calls. true is experimental and may cause instabilities and crashes since Java doesn't support explicit unmapping of file regions mapped to virtual memory.
core.packedGitOpenFiles128Maximum number of streams to open at a time. Open packs count against the process limits.
core.packedGitUseStrongRefsfalseWhether the window cache should use strong references (true) or SoftReferences (false). When false the JVM will drop data cached in the JGit block cache when heap usage comes close to the maximum heap size.
core.packedIndexGitUseStrongRefstrueWhether pack indices should use strong references (true) or SoftReferences (false). When false the JVM will drop data cached in the JGit pack indices when heap usage comes close to the maximum heap size.
core.packedGitWindowSize8 kiBNumber of bytes of a pack file to load into memory in a single read operation. This is the “page size” of the JGit buffer cache, used for all pack access operations. All disk IO occurs as single window reads. Setting this too large may cause the process to load more data than is required; setting this too small may increase the frequency of read() system calls.
core.precomposeUnicodetrue on Mac OSMacOS only. When true, JGit reverts the unicode decomposition of filenames done by Mac OS.
core.quotePathtrueCommands that output paths (e.g. ls-files, diff), will quote “unusual” characters in the pathname by enclosing the pathname in double-quotes and escaping those characters with backslashes in the same way C escapes control characters (e.g. \t for TAB, \n for LF, \\ for backslash) or bytes with values larger than 0x80 (e.g. octal \302\265 for “micro” in UTF-8).
core.repositoryFormatVersion1Internal version identifying the repository format and layout version. Don't set manually.
core.sha1ImplementationjavaChoose the SHA1 implementation used by JGit. Set it to java to use JGit's Java implementation which detects SHA1 collisions if system property org.eclipse.jgit.util.sha1.detectCollision is unset or true. Set it to jdkNative to use the native implementation available in the JDK, can also be set using system property org.eclipse.jgit.util.sha1.implementation. If both are set the system property takes precedence. Performance of jdkNative is around 10% higher than java when detectCollision=false and 30% higher when detectCollision=true.
core.streamFileThreshold50 MiBThe size threshold beyond which objects must be streamed.
core.supportsAtomicFileCreationtrueWhether the filesystem supports atomic file creation.
core.symlinksAuto detect if filesystem supports symlinksIf false, symbolic links are checked out as small plain files that contain the link text.
core.trustFolderStattrueWhether to trust the pack folder‘s, packed-refs file’s and loose-objects folder's file attributes (Java equivalent of stat command on *nix). When looking for pack files, if false JGit will always scan the .git/objects/pack folder and if set to true it assumes that pack files are unchanged if the file attributes of the pack folder are unchanged. When getting the list of packed refs, if false JGit will always read the packed-refs file and if set to true it uses the file attributes of the packed-refs file and will only read it if a file attribute has changed. When looking for loose objects, if false and if a loose object is not found, JGit will open and close a stream to .git/objects folder (which can refresh its directory listing, at least on some NFS clients) and retry looking for that loose object. Setting this option to false can help to workaround caching issues on NFS, but reduces performance.
core.trustPackedRefsStatunsetWhether to trust the file attributes (Java equivalent of stat command on *nix) of the packed-refs file. If never JGit will ignore the file attributes of the packed-refs file and always read it. If always JGit will trust the file attributes of the packed-refs file and will only read it if a file attribute has changed. after_open behaves the same as always, except that the packed-refs file is opened and closed before its file attributes are considered. An open/close of the packed-refs file is known to refresh its file attributes, at least on some NFS clients. If unset, JGit will use the behavior described in trustFolderStat.
core.worktreeRoot directory of the working tree if it is not the parent directory of the .git directoryThe path to the root of the working tree.

fetch options

optiondefaultgit optiondescription
fetch.useNegotiationTipfalseWhen enabled it restricts the client negotiation on unrelated branches i.e. only send haves for the refs that the client is interested in fetching.

gc options

optiondefaultgit optiondescription
gc.aggressiveDepth50The depth parameter used in the delta compression algorithm used by aggressive garbage collection.
gc.aggressiveWindow250The window size parameter used in the delta compression algorithm used by aggressive garbage collection.
gc.auto6700Number of loose objects until auto gc combines all loose objects into a pack and consolidates all existing packs into one. Setting to 0 disables automatic packing of loose objects.
gc.autoDetachtrueMake auto gc return immediately and run in background.
gc.autoPackLimit50Number of packs until auto gc consolidates existing packs (except those marked with a .keep file) into a single pack. Setting gc.autoPackLimit to 0 disables automatic consolidation of packs.
gc.logExpiry1.day.agoIf the file gc.log exists, then auto gc will print its content and exit successfully instead of running unless that file is more than gc.logExpiry old.
gc.pruneExpire2.weeks.agoGrace period after which unreachable objects will be pruned.
gc.prunePackExpire1.hour.agoGrace period after which packfiles only containing unreachable objects will be pruned.
gc.writeChangedPathsfalseWhether bloom filter should be written to commit-graph during a gc operation.
gc.writeCommitGraphfalseIf true, then gc will rewrite the commit-graph file when jgit gc is run.

http options

optiondefaultgit optiondescription
http.cookieFileAbsolute path (with tilde expansion) of a cookie file in Netscape format.
http.cookieFileCacheLimit10JGit caches at most this number of the most recently used cookie files.
http.extraHeaderExtra HTTP header(s) to send with HTTP requests, in the format “Key: Value”. May appear multiple times; an empty option clears the list.
http.followRedirectsinitialtrue, false, or initial. Whether to follow a redirect always, never, or only on the first HTTP request in a git remote operation.
http.maxRedirects5Maximum number of redirects to follow; can be overridden via the Java system property http.maxRedirects.
http.postBuffer1 MiBMaximum size in bytes for single HTTP POST requests; for larger requests, HTTP 1.1 chunked transfer is used.
http.saveCookiesfalseBoolean; if true and http.cookieFile is set, save received cookies.
http.sslVerifytrueBoolean; whether to check SSL certificates in HTTPS connections.
http.userAgentUser-agent string to send with HTTP requests. Must be 7bit-ASCII. Can be overridden via environment variable GIT_HTTP_USER_AGENT.

All http.* options can also be specified in a URL-specific way using the format http.<url>.*. See the official git config documentation for details.

Proxy configuration uses the standard Java mechanisms via class java.net.ProxySelector.

pack options

optiondefaultgit optiondescription
pack.bitmapContiguousCommitCount100Count of most recent commits for which to build bitmaps.
pack.bitmapDistantCommitSpan5000Span of commits when building bitmaps for distant history.
pack.bitmapExcessiveBranchCount100The count of branches deemed “excessive”. If the count of branches in a repository exceeds this number and bitmaps are enabled, “inactive” branches will have fewer bitmaps than “active” branches.
pack.bitmapExcludedRefsPrefixesThe refs prefixes to be excluded when building bitmaps. May be specified more than once to exclude multiple prefixes.
pack.bitmapInactiveBranchAgeInDays90Age in days that marks a branch as “inactive” for bitmap creation.
pack.bitmapRecentCommitCount20000Count at which to switch from bitmapRecentCommitSpan to bitmapDistantCommitSpan.
pack.bitmapRecentCommitSpan100Span of commits when building bitmaps for recent history.
pack.buildBitmapstrue⃞ synonym for repack.writeBitmapsWhether index writer is allowed to build bitmaps for indexes.
pack.compressioncore.compressionCompression level applied to objects in the pack.
pack.cutDeltaChainsfalseWhether existing delta chains should be cut at {@link #getMaxDeltaDepth()
pack.deltaCacheLimit100Maximum size in bytes of a delta to cache.
pack.deltaCacheSize50 MiBSize of the in-memory delta cache.
pack.deltaCompressiontrueWhether the writer will create new deltas on the fly. true if the pack writer will create a new delta when either pack.reuseDeltas is false, or no suitable delta is available for reuse.
pack.depth50Maximum depth of delta chain set up for the pack writer.
pack.indexVersion2Pack index file format version.
pack.minBytesForObjSizeIndex-1Minimum size of an object (inclusive, in bytes) to be included in the size index. -1 to disable the object size index.
pack.minSizePreventRacyPack100 MiBMinimum packfile size for which we wait before opening a newly written pack to prevent its lastModified timestamp could be racy if pack.waitPreventRacyPack is true.
pack.preserveOldPacksfalseWhether to preserve old packs during gc in the objects/pack/preserved directory. This can avoid rare races between gc removing pack files and other concurrent operations. If this option is false data loss can occur in rare cases when an object is believed to be unreferenced when object repacking is running, and then garbage collection deletes it while another concurrent operation references this object shortly before garbage collection deletes it. When this happens, a new reference is created which points to a now missing object.
pack.prunePreservedfalseWhether to prune preserved pack files from the previous run of gc from the objects/pack/preserved directory. This helps to limit the additional storage space needed to preserve old packs when pack.preserveOldPacks = true.
pack.reuseDeltastrueWhether to reuse deltas existing in repository.
pack.reuseObjectstrueWhether to reuse existing objects representation in repository.
pack.searchForReuseTimeoutSearch for reuse phase timeout. Expressed as a Duration, i.e.: 50sec.
pack.singlePackfalseWhether all of refs/* should be packed in a single pack.
pack.threads0 (auto-detect number of processors)Number of threads to use for delta compression.
pack.waitPreventRacyPackfalseWhether we wait before opening a newly written pack to prevent its lastModified timestamp could be racy.
pack.window10Number of objects to try when looking for a delta base per thread searching for deltas.
pack.windowMemory0 (unlimited)Maximum number of bytes to put into the delta search window.

repack options

optiondefaultgit optiondescription
repack.packKeptObjectstrue when pack.buildBitmaps is set, false otherwiseInclude objects in packs locked by a .keep file when repacking.

Java System Properties

system propertydefaultdescription
REVWALK_USE_PRIORITY_QUEUEfalseIf set to true RevWalk uses DateRevPriorityQueue which is faster, otherwise it uses the old DateRevQueue.

Tracing

GIT_TRACE_PERFORMANCE: set this to true as a Java system property or environment variable to trace timings from the progress monitor. The system property takes precedence. Defaults to false. Can also be set programmatically via ProgressMonitor#showDuration.

Example using JGit CLI:

$ GIT_TRACE_PERFORMANCE=true jgit clone https://foo.bar/foobar
Cloning into 'foobar'...
remote: Counting objects: 1 [0.002s]
remote: Finding sources: 100% (15531/15531) [0.006s]
Receiving objects:      100% (169737/169737) [13.045s]
Resolving deltas:       100% (67579/67579) [1.842s]