Git clone ssh with spaces in username, path and different drive

前端 未结 4 789
抹茶落季
抹茶落季 2021-01-21 06:29

I have quantity 3 windows 7 professional machines. Two are setup as development machines (one desktop and one laptop) with Git installed. The third is setup as a file server wit

4条回答
  •  遥遥无期
    2021-01-21 06:55

    Well, after some time I worked out how to accomplish this.

    git clone "ssh://user name@file-server:/D/path to/repo.git"
    

    Git at the command line is no different from any other command that has spaces in it. Enclose it in quotes... To be more specific, double quotes are less restrictive if using special characters.

    Having a Git repository on a drive other than the default install (C:/) drive does not complicate things.

    The file extension '.git' is required for it to work.

    Is the path case sensitive? Well, when using windows case sensitivity is not a problem. But, for you to be correct and error free (especially between OS), it is always best to reflect the practice of case sensitivity. IE: 'A' is different to 'a'.

    Finally, to reflect a different drive letter to that which Git is installed, place a colon between the computer name and the forward slash. This was the issue tripping me up.

    I hope this information helps other.

提交回复
热议问题