.gitconfig file is on remote drive (M:\), how to move it to C:\

Hi all,

I am a beginner using GIT.
I have problems because my .gitignore is now on my M:\ drive. This drive is only available when connected to VPN. A while ago this file got currupted becuase I had shut down VPN before shutting down Python (that uses GIT). It was quite a challenge to remove this file and get things running again.
I would like my .gitignore file to be somewhere on my C:\ drive.
Of course I can move it, but I guess I will need to change some settings so that GIT can still find the file. Or not???
How to manage this?

Kind regards,

Koen.

Hi @KoenMeesters

This isn’t really a GitLab question, but Git will store your config in $HOME, so I think it’ll be tricky to move the file around without causing problems for other applications.

There are some SO questions on this that might be of more use to you.

Thanks for your hint.
I guess the solution to my problem is somewhere in the stackoverflow reference you have added…
To me it feels that some of the proposed approaches are quite tricky. And I also might lack the ‘admin rights’ to make some of the suggested changes.
At least it is a start. Maybe our IT department is willing to assist me on this. But so far they said it was none of their business to get GIT working as it is not on their list of supported software…
That is what happens if you give them a well defined job description and a limited budget…

1 Like

Problem was solved.
Analysis: the config file was somehow not owned by me. Our IT department was also not allowed to access this file with admin rights.
Solution: Finally the a cache reset of the M: drive was performed. This took around 10 seconds… and then things were fixed. I had to make a full copy of my M: drive before because this type of reset had some risks (acc. to IT department), and that took hours…
Potential cause: My M drive is only available via VPN when I work from home. Perhaps VPN was not working when Git was closed down and caused a corruption.
Future: I made the file available offline. I hope that will prevent future problems. Another way would of course to not have the config file on M:. But (as you indicated), that will be tricky and also far out of my access rights (as a simple user).

1 Like