Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pre-commit Error missing config value GIT_CONFIG_VALUE_0

When i commit changes via Github Desktop, pre-commit cannot handle the changes and commit them but overwrites all other stages changes (the once i didn't intent to commit now) by its improvements.

This appears since during a commit in Github Desktop to my local branch, Avast free antivirus interrupted the process to check some file for virus. Since i didn't want Avast to interrupt it i canceled the scan, probably making things worse.

Now i get the following message when i'm trying to commit:error message

I tried already to use

  • git reset, git update-indes,
  • delete the repo and set it up new
  • use pre-commit uninstall and install
  • use pre-commit run --all-files

On another machine, the same repo runs smoothly. Does anyone has an idea what and how i have to reset to solve this issue?

Here is the pre-commit log:

version information

pre-commit version: 3.7.1
git --version: git version 2.45.1.windows.1
sys.version:
    3.11.0 (main, Oct 24 2022, 18:26:48) [MSC v.1933 64 bit (AMD64)]
sys.executable: C:\Users\UsrName\Dokumente\GitHub\RepoName\.env\Scripts\python.exe
os.name: nt
sys.platform: win32

error information

An unexpected error has occurred: CalledProcessError: command: ('C:\\Users\\UsrName\\AppData\\Local\\GitHubDesktop\\app-3.4.2\\resources\\app\\git\\mingw64\\bin\\git.EXE', '-c', 'core.autocrlf=false', 'apply', '--whitespace=nowarn', 'C:\\Users\\UsrName\\.cache\\pre-commit\\patch1719821150-18184')
return code: 128
stdout: (none)
stderr:
    error: missing config value GIT_CONFIG_VALUE_0
    fatal: unable to parse command-line config
Traceback (most recent call last):
  File "C:\Users\UsrName\Dokumente\GitHub\RepoName\.env\Lib\site-packages\pre_commit\staged_files_only.py", line 29, in _git_apply
    cmd_output_b('git', *args)
  File "C:\Users\UsrName\Dokumente\GitHub\RepoName\.env\Lib\site-packages\pre_commit\util.py", line 111, in cmd_output_b
    raise CalledProcessError(returncode, cmd, stdout_b, stderr_b)
pre_commit.util.CalledProcessError: command: ('C:\\Users\\UsrName\\AppData\\Local\\GitHubDesktop\\app-3.4.2\\resources\\app\\git\\mingw64\\bin\\git.EXE', 'apply', '--whitespace=nowarn', 'C:\\Users\\UsrName\\.cache\\pre-commit\\patch1719821150-18184')
return code: 128
stdout: (none)
stderr:
    error: missing config value GIT_CONFIG_VALUE_0
    fatal: unable to parse command-line config

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\UsrName\Dokumente\GitHub\RepoName\.env\Lib\site-packages\pre_commit\staged_files_only.py", line 86, in _unstaged_changes_cleared
    _git_apply(patch_filename)
  File "C:\Users\UsrName\Dokumente\GitHub\RepoName\.env\Lib\site-packages\pre_commit\staged_files_only.py", line 32, in _git_apply
    cmd_output_b('git', '-c', 'core.autocrlf=false', *args)
  File "C:\Users\UsrName\Dokumente\GitHub\RepoName\.env\Lib\site-packages\pre_commit\util.py", line 111, in cmd_output_b
    raise CalledProcessError(returncode, cmd, stdout_b, stderr_b)
pre_commit.util.CalledProcessError: command: ('C:\\Users\\UsrName\\AppData\\Local\\GitHubDesktop\\app-3.4.2\\resources\\app\\git\\mingw64\\bin\\git.EXE', '-c', 'core.autocrlf=false', 'apply', '--whitespace=nowarn', 'C:\\Users\\UsrName\\.cache\\pre-commit\\patch1719821150-18184')
return code: 128
stdout: (none)
stderr:
    error: missing config value GIT_CONFIG_VALUE_0
    fatal: unable to parse command-line config

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\UsrName\Dokumente\GitHub\RepoName\.env\Lib\site-packages\pre_commit\staged_files_only.py", line 29, in _git_apply
    cmd_output_b('git', *args)
  File "C:\Users\UsrName\Dokumente\GitHub\RepoName\.env\Lib\site-packages\pre_commit\util.py", line 111, in cmd_output_b
    raise CalledProcessError(returncode, cmd, stdout_b, stderr_b)
pre_commit.util.CalledProcessError: command: ('C:\\Users\\UsrName\\AppData\\Local\\GitHubDesktop\\app-3.4.2\\resources\\app\\git\\mingw64\\bin\\git.EXE', 'apply', '--whitespace=nowarn', 'C:\\Users\\UsrName\\.cache\\pre-commit\\patch1719821150-18184')
return code: 128
stdout: (none)
stderr:
    error: missing config value GIT_CONFIG_VALUE_0
    fatal: unable to parse command-line config

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\UsrName\Dokumente\GitHub\RepoName\.env\Lib\site-packages\pre_commit\error_handler.py", line 73, in error_handler
    yield
  File "C:\Users\UsrName\Dokumente\GitHub\RepoName\.env\Lib\site-packages\pre_commit\main.py", line 389, in main
    return hook_impl(
           ^^^^^^^^^^
  File "C:\Users\UsrName\Dokumente\GitHub\RepoName\.env\Lib\site-packages\pre_commit\commands\hook_impl.py", line 271, in hook_impl
    return retv | run(config, store, ns)
                  ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\UsrName\Dokumente\GitHub\RepoName\.env\Lib\site-packages\pre_commit\commands\run.py", line 418, in run
    with contextlib.ExitStack() as exit_stack:
  File "C:\Users\UsrName\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 586, in __exit__
    raise exc_details[1]
  File "C:\Users\UsrName\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 571, in __exit__
    if cb(*exc_details):
       ^^^^^^^^^^^^^^^^
  File "C:\Users\UsrName\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 144, in __exit__
    next(self.gen)
  File "C:\Users\UsrName\Dokumente\GitHub\RepoName\.env\Lib\site-packages\pre_commit\staged_files_only.py", line 112, in staged_files_only
    with _intent_to_add_cleared(), _unstaged_changes_cleared(patch_dir):
  File "C:\Users\UsrName\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 144, in __exit__
    next(self.gen)
  File "C:\Users\UsrName\Dokumente\GitHub\RepoName\.env\Lib\site-packages\pre_commit\staged_files_only.py", line 96, in _unstaged_changes_cleared
    _git_apply(patch_filename)
  File "C:\Users\UsrName\Dokumente\GitHub\RepoName\.env\Lib\site-packages\pre_commit\staged_files_only.py", line 32, in _git_apply
    cmd_output_b('git', '-c', 'core.autocrlf=false', *args)
  File "C:\Users\UsrName\Dokumente\GitHub\RepoName\.env\Lib\site-packages\pre_commit\util.py", line 111, in cmd_output_b
    raise CalledProcessError(returncode, cmd, stdout_b, stderr_b)
pre_commit.util.CalledProcessError: command: ('C:\\Users\\UsrName\\AppData\\Local\\GitHubDesktop\\app-3.4.2\\resources\\app\\git\\mingw64\\bin\\git.EXE', '-c', 'core.autocrlf=false', 'apply', '--whitespace=nowarn', 'C:\\Users\\UsrName\\.cache\\pre-commit\\patch1719821150-18184')
return code: 128
stdout: (none)
stderr:
    error: missing config value GIT_CONFIG_VALUE_0
    fatal: unable to parse command-line config
like image 894
Ramon Droop Avatar asked Jun 30 '26 03:06

Ramon Droop


1 Answers

There's a temporary fix/workaround for this.

  1. Exit GitHub Desktop.
  2. Go to your GitHub Desktop resource app folder. It should be listed in the error you receive, in your case C:\\Users\\UsrName\\AppData\\Local\\GitHubDesktop\\app-3.4.2\\resources\\app. In my case I'm on version 3.4.3 now, so I would choose whatever is newest.
  3. Open the renderer.js file in a text editor
  4. Search for "GIT_CONFIG_VALUE_0":"" in the file
  5. Change it to "GIT_CONFIG_VALUE_0":null. (some people have reported setting the value to 0 or "*" and it also working)
  6. Restart GitHub Desktop
  7. I assume we'll need to re-apply this fix every time the version updates.

Fix found in this thread - https://github.com/desktop/desktop/issues/18945. Unfortunately they closed the issue. If you'd like to ask for them to investigate a long-term fix on that issue maybe we can get movement.

like image 147
Major Major Avatar answered Jul 03 '26 08:07

Major Major