User Tools

Site Tools


Sidebar

Imprint

kb:scc:git:debugging

04 Debugging

Discard changes

If your client is stuck and you cannot discard changes:

  git clean -xfd
  git submodule foreach --recursive git clean -xfd
  git reset --hard
  git submodule foreach --recursive git reset --hard
  git submodule update --init --recursive

File Path Too Long

  Checking out d6d02b91 as v3.5.1...
  error: unable to create file some/long/path/here: Filename too long

Git has a limit of 4096 characters for a filename, except on Windows when Git is using msys. It uses an older version of the Windows API and there's a limit of 260 characters for a filename (details: https://github.com/msysgit/git/pull/110). This can be worked around by setting

  git config --global core.longpaths true

Git is build as a combination of scripts and compiled code. With the above change some of the scripts might fail. That's the reason for core.longpaths not to be enabled by default.

Server certificate verification failure

For some setups, the SSL certificate verification will fail. Error messages might be:

  error: SSL certificate problem, verify that the CA cert is OK. Details:
  error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed while accessing (repo)

or

  Cloning into 'c:\repo-path'...
  ssh_exchange_identification: Connection closed by remote host
  fatal: Could not read from remote repository

or

  fatal: unable to access 'https://xxx/yyy.git/': error setting certificate verify locations:
  CAfile: C:\xxx\yyy.tmp\CI_SERVER_TLS_CA_FILE
  CApath: none

If it is acceptable to turn off the SSL validation instead of actually solving the issue this will turn off validation for the current repo

  git config --local http.sslVerify false

If you would rather have this as a default behaviour for git then the following will do it for all repos

  git global --local http.sslVerify false

and for those that would rather add to the .git/config file directly the entry looks like

  [http]
      sslVerify = false
kb/scc/git/debugging.txt · Last modified: 2020/05/29 08:30 by joerg.hampel