Johnny Reis
Johnny Reis

Reputation: 21

.gitconfig installed on wrong drive on Windows 10

I have a machine running Windows 10. It has a SSD C: and another hard drive Z:

I've successfully installed git onto Z (by choosing Z:/Program Files in the installer), but .gitconfig was installed to C:/~. This is fine most of the time (committing, pushing, and pulling are all okay), but some commands are extremely slow. In particular, when I'm trying git stash or git reset --hard {sha}.

Is there a way to move my gitconfig from one drive to the other? I'm also open to reinstalling git, but the last time I did this the .gitconfig ended up in the same place.

Upvotes: 2

Views: 1105

Answers (1)

Keshan Nageswaran
Keshan Nageswaran

Reputation: 8178

It's better to create a symbolic link for gitconfig.

  1. Move your .gitconfig from user home directory, to the directory where you want.
  2. Run command line as Administrator
  3. Go to your user home directory
  4. Enter mklink .gitconfig \PathForNewLocationOfConfig.gitconfig

Upvotes: 1

Related Questions