3

Under Jenkins I am having the same longpaths issue described in this thread.

This git config --system core.longpaths true solution is supposed to fix the issue for me (I have not tried it yet), but... where do I place it?

The answer states "You should be able to run the command... or add it to one of your git config files manually" -- which of the git config files?

Community
  • 1
  • 1
datps
  • 768
  • 1
  • 6
  • 16

2 Answers2

5

You can place it on four files (where Jenkins is installed) as described on the git documentation:

If not set explicitly with --file, there are four files where git config will search for configuration options:

$(prefix)/etc/gitconfig

System-wide configuration file.

$XDG_CONFIG_HOME/git/config

Second user-specific configuration file. If $XDG_CONFIG_HOME is not set or empty, $HOME/.config/git/config will be used. Any single-valued variable set in this file will be overwritten by whatever is in ~/.gitconfig. It is a good idea not to create this file if you sometimes use older versions of Git, as support for this file was added fairly recently.

~/.gitconfig

User-specific configuration file. Also called "global" configuration file.

$GIT_DIR/config

Repository specific configuration file.

Akram Fares
  • 1,653
  • 2
  • 17
  • 32
3

For the benefit of anyone having the same question:

After consulting with the git config documentation, I came to the conclusion that this config change should only be run once, using the same git.exe path that is configured in Jenkins:

"C:\Program Files (x86)\Git\bin\git.exe" config --system core.longpaths true

This can be later verified by listing the various settings:

"C:\Program Files (x86)\Git\bin\git.exe" config -l

core.symlinks=false
core.autocrlf=true
core.longpaths=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
pack.packsizelimit=2g
help.format=html
http.sslcainfo=/bin/curl-ca-bundle.crt
sendemail.smtpserver=/bin/msmtp.exe
diff.astextplain.textconv=astextplain
rebase.autosquash=true
merge.tool=kdiff3
mergetool.kdiff3.path=C:/Program Files (x86)/KDiff3/kdiff3.exe
diff.guitool=kdiff3
difftool.kdiff3.path=C:/Program Files (x86)/KDiff3/kdiff3.exe
core.editor="C:/Program Files (x86)/GitExtensions/GitExtensions.exe" fileeditor

There may be other ways, but I only tried this one.

datps
  • 768
  • 1
  • 6
  • 16
  • 1
    In my case you have set longpaths before, you should use the --replace-all option: git config --system --replace-all core.longpaths true – Picrochole Mar 08 '16 at 16:49