“Could not get current working directory” error on git clone
I try to clone a Git repository hosted on a VSTS instance in a PowerShell script to a network share:
git clone https://user:email@example.com/DefaultCollection/MyProject/_git/MyRepository \\MyServer\MyBackupDirectory\MyRepository --mirror
While this works fine run from my local machine it fails while run on another machine (VSTS build agent) with the following error:
- git credential.helper does not store username password
- Change Visual Studio Online team project source control from TFVC to Git
- Git - Visual Studio 2013 - Publish to VS Online
- Visual Studio Team Services with GitHub
- Azure: Deploy from source control using Visual Studio Team Services
- How to CI build branches in VSTS
fatal: Could not get current working directory: No such file or directory
The same error is thrown if I run the above command directly in PowerShell. I don’t see how this could be related to the working directory. I suspect that it has something to do with permissions on the target file share, but the user has full control on the target path and with the same user I can manually create / delete folders in the target path.
Opposite to Git – fatal: Could not get current working directory? I also don’t change working directory or delete directories.
If I don’t clone with
--mirror an empty directory is created on the target file share and I get the following errors:
fatal: Could not get current working directory: No such file or directory Deletion of directory ´\\MyServer\MyBackupDirectory\MyRepository´ failed. Should I try again? (y/n)