1

My github password includes @ character. In doing git clone, I am getting an error message could not resolve host: my@github.com considering my password is "pass@my". Using backslash too presents the same error.

I am typing:

git clone myusername:pass@my@github.com/myusername/myrepo.git D:/myworkspace

How to resolve this?

devautor
  • 2,506
  • 4
  • 21
  • 31
  • 1
    Can you use an SSH key instead of a password? – Chris Martin Nov 12 '15 at 23:22
  • How are you cloning this? – Makoto Nov 12 '15 at 23:28
  • @ChrisMartin Thanks for your time but maybe you could elaborate/guide, as I am not very familiar with the process. – devautor Nov 12 '15 at 23:32
  • 1
    @mirror [GitHub's docs](https://help.github.com/categories/ssh/) do a better job than I could. – Chris Martin Nov 12 '15 at 23:34
  • @Makoto Using git clone command from Windows cmd – devautor Nov 12 '15 at 23:35
  • What exactly are you typing? Feel free to omit concrete details like your password and username... – Makoto Nov 12 '15 at 23:35
  • @Makoto This: git clone https://myusername:pass@my@github.com/myusername/myrepo.git D:/myworkspace And as an answer below suggests, URL encoding does the job. But, you can sure teach me anything! – devautor Nov 12 '15 at 23:39
  • Why aren't you able to use the conventional way: `git://git@github.com:myusername/myrepo.git` ? Failing *that*, why not try it through HTTPS? `https://github.com/myusername/repo.git`. You shouldn't be required to enter your password to *clone* the repository. – Makoto Nov 12 '15 at 23:41
  • 1
    @Makoto Didn't know that, thanks! Found this http://stackoverflow.com/questions/10054318/how-to-provide-username-and-password-when-run-git-clone-gitremote-git – devautor Nov 12 '15 at 23:46

1 Answers1

6

Try URL-encoding it: pass%40my

bfontaine
  • 18,169
  • 13
  • 73
  • 107