Skip to main content

Git-related issues

This section provides help for issues related to the usage of Git repositories.

Token verification error

If you try to add a new Git token in your user settings and get a message like this:

Error while creating the Git Token. Data cannot be saved, since the provided Git access credentials are not valid 
for Git provider "GitProvider".

Then this might have happened due to wrong credentials. If you are trying to connect to GitLab, then make sure you use the username and not your e-mail address as this might be your first intention.

Same applies also for other Git provider like GitHub or Bitbucket.

ℹ️note

The input for the username is case-sensitive, so make sure each character matches the username stored in your Git profile.

Windows: git Filename too long

If a git interaction fails on Windows with an error like this

error: open("myservice/src/main/java/foo/bar/myservice/MyClass.java"): Filename too long
error: unable to index file 'myservice/src/main/java/foo/bar/myservice/MyClass.java'
fatal: adding files failed

Then this might have happened due to too long filenames on the Windows system. Git has a limit of 4096 characters for a filename, except on Windows when Git is compiled with msys. It uses an older version of the Windows API and there's a limit of 260 characters for a filename.

It's a limitation of msys and not of Git. You can read the details here: msygit

You can circumvent this by using another Git client on Windows or set core.longpaths to true as explained in other answers.

So either execute

git config --system core.longpaths true

or

git config core.longpaths true

if this is not working due to the error error: could not lock config file C:/Program Files/Git/etc/gitconfig: Permission denied, then manually edit with local administrator permissions C:/Program Files/Git/etc/gitconfig and add longpaths = true to the section [core] similar to

[core]
longpaths = true