Total Pageviews

Monday 11 August 2014

Git Extensions: syntax error near unexpected token `('

Git Extensions is a graphical user interface for Git that allows you to control Git without using the command line.

The Problem

After installing Git Extensions you may come across the following error when cloning a repository;
 

\"C:/Program Files (x86)/GitExtensions/GitCredentialWinStore/git-credential-winstore.exe\" get: -c: line 0: syntax error near unexpected token `('

\"C:/Program Files (x86)/GitExtensions/GitCredentialWinStore/git-credential-winstore.exe\" get: -c: line 0: `\"C:/Program Files (x86)/GitExtensions/GitCredentialWinStore/git-credential-winstore.exe\" get'

This happens when there is a syntax error in the git config file, the git config file can be found here;

C:\Users\<username>\.gitconfig

The Solution

In the credential section of the config file, you will notice that there are extra backslashes.

helper = !\\\"C:/Program Files (x86)/GitExtensions/GitCredentialWinStore/git-credential-winstore.exe\\\"

Remove the extra backslashes so that the helper key's value looks like below.

helper = !\"C:/Program Files (x86)/GitExtensions/GitCredentialWinStore/git-credential-winstore.exe\"

You should now be able to successfully clone your repository.

Summary

Hopefully this tip will save you some time so that you can focus your efforts on testing.

If you have found this or any of my other blog posts helpful, please feel free to leave a comment.

Happy Testing!