0

I originally did a

git init

while I was on a pc that was mapped to a network drive. The computer that was doing the actual file work was on a remote server (I was accessing a mapped network drive in the terminal when I did git init)

If I am accessing the files and using git commands like git status from the mapped drive all is good

Its when I remote into the actual server that has the files on its hard drive and try to do

git status

it says the following:

fatal: Could not switch to 'Y:/': No such file or directory

On the computer I was using to do the git init the mapped drive was named Y: (the server was mapped to the Y: drive)

On the actual server, however, the files are actually sitting in the D: drive

Is there something I can do WITHOUT changing the mapped drive and actual drive to be the same drive name so this can be fixed where I can use git while working remotely and while actually logging in

If there is nothing I can do without changing the directory names so be it I guess..

Thanks for any and all help

Coty Embry
  • 958
  • 1
  • 11
  • 24

1 Answers1

0

The following question helped me answer it and figure it out myself

What is GIT_WORK_TREE, why have I never needed to set this ENV var, why now?

and this one

git with --git-dir= results in 'not a git repository'

I had to do the following command when I ran git status

git --git-dir=/d/.git --work-tree=/d/ status

where /d/ is synonymous with D:/

Community
  • 1
  • 1
Coty Embry
  • 958
  • 1
  • 11
  • 24