Skip to content

Not possible to set GIT_SSH to a path with spaces #692

Closed
@klikh

Description

@klikh

Windows 7 64-bit
git version 2.7.2.windows.1
Git Bash

I have an executable script located in a folder with spaces, and what to use it for git over SSH. However, it seems that it is simply not possible to define GIT_SSH so that it points to a path with spaces.

Neither of the following works:

$ export GIT_SSH=C:\\Users\\John\ Smith\\git-ssh-.bat
$ export GIT_SSH=/c/Users/John\ Smith/git-ssh-.bat

$ git fetch
'C:\Users\John' is not recognized as an internal or external command,
operable program or batch file.
fatal: Could not read from remote repository.

Quoting gives another error but still doesn't work:

$ export GIT_SSH="/c/Users/John\ Smith/git-ssh-.bat"
$ export GIT_SSH=\"/c/Users/John\ Smith/git-ssh-.bat\"
$ export GIT_SSH="C:\\Users\\John\ Smith\\git-ssh-.bat"
$ export GIT_SSH="C:\Users\John Smith\git-ssh-.bat"

$ git fetch
error: cannot spawn C:/Users/John/ Smith/git-ssh-.bat: No such file or directory
fatal: unable to fork

I would appreciate if you give me a workaround (if there is any workaround except "use path without spaces") until the issue is fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions