3

Excuses:
I see this: Escape @ character in git proxy password But It's about http.proxy param, and p%4055 does not work for me about url param.

My question:
I use git version 1.7.1
My password repository is: p@55
And I use gitlab server, and centos for client.
In .git/config file, i have be like this:

[remote "origin"]
url = http://user:p@55@domain.com:port/repo.git

But when I pull it, Gave me this error:

error: Couldn't resolve host '55:domain.com' while accessing ...

I know about escape @ char, but:

I try p\@55, Gave me this error:

fatal: bad config file line 8 in .git/config

I try p%4055, Gave me this error:

error: The requested URL returned error: 401 while accessing ...
Nabi K.A.Z.
  • 9,887
  • 6
  • 59
  • 81

3 Answers3

7

I just upgrade git version from 1.7.1 to 2.11.1 and this worked for me:

url = http://user:p%4055@domain.com:port/repo.git
Nabi K.A.Z.
  • 9,887
  • 6
  • 59
  • 81
3

Try using the URL Encoded value of the @ - (%40) symbol.

an example in your case:

URL = http://user:p%4055@domain.com:port/repo.git

Edit:

if above method doesn't work please use below method:

sshpass -p password git clone ssh://username@onboard.com/srv/git/repo

Shivang Agarwal
  • 1,825
  • 1
  • 14
  • 19
  • As I said in end of my question about `p%4055`, give me error.... so, as I said, I want to git pull, and not clone! and so I don't want use it in CLI, and I want put in config file. – Nabi K.A.Z. Jun 24 '17 at 07:38
  • i added one more method sshpass – Shivang Agarwal Jun 24 '17 at 07:39
  • I want put into config file, and I don't want to use under CLI. and also I want to do git pull and not git clone!, and so http protocol not ssh.... – Nabi K.A.Z. Jun 24 '17 at 07:45
  • `sshpass -p p@55 git pull` it worked. but as I said, I want to config git config file. one of the reason is the password show in history for anyone. – Nabi K.A.Z. Jun 24 '17 at 07:50
1

You can use git credentials helper:

Is there a way to skip password typing when using https:// on GitHub?

atupal
  • 16,404
  • 5
  • 31
  • 42