Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git warning: unable to access 'P:\/.gitconfig': Invalid argument

Tags:

git

git-config

I am just testing git. I ran the following command:

git config user.email "[email protected]" 

I now get this when git status and others:

C:\gitg\g1>git status warning: unable to access 'P:\/.gitconfig': Invalid argument warning: unable to access 'P:\/.gitconfig': Invalid argument warning: unable to access 'P:\/.gitconfig': Invalid argument # On branch master warning: unable to access 'P:\/.gitconfig': Invalid argument nothing to commit, working directory clean  C:\gitg\g1> 
like image 927
Chris G. Avatar asked Feb 08 '13 13:02

Chris G.


People also ask

Why git config is not working?

Try opening it and see do this file look like this. Try setting global config through command line by- git config --global user. email "[email protected]" It automatically set the . gitconfig in the directory it needed.

What is the .gitconfig file?

The git config command is a convenience function that is used to set Git configuration values on a global or local project level. These configuration levels correspond to . gitconfig text files. Executing git config will modify a configuration text file.


2 Answers

I just encountered this error.
Executing set HOMEPATH in the command line gave this output:

HOMEPATH=\ 

Simply deleting this environment variable via set HOMEPATH= fixed the problem.

like image 155
Daniel Hilgarth Avatar answered Sep 21 '22 15:09

Daniel Hilgarth


I experienced a similar issue when not connected to my work network via VPN. Deleting the all the HOME% variables did not work. Deleting the network drive it was trying to access did work. Running the following from a command window worked for me:

net use H: /delete

As a note, I did delete the HOME% variables, but it did work until the command above was run.

like image 39
JK Dennis Avatar answered Sep 18 '22 15:09

JK Dennis