11

I would like to have my git username saved in remote url address in order not to type it every time I push or pull.

I found many answers (such as this one) which solves the problem. The thing is that my username contains @ since it is (and unfortunatelly must be) an email address.

When I enter http://me@domain.com@myrepo.git, the parser is confused and takes only me as the username.

How can I solve it? Is it even posisble? Unfortunatelly, I can't use ssh, to https is the only option.

Community
  • 1
  • 1
petrbel
  • 2,428
  • 5
  • 29
  • 49
  • 2
    Possible duplicate of [Escape @ character in git proxy password](http://stackoverflow.com/questions/6172719/escape-character-in-git-proxy-password) – erikvimz May 20 '16 at 09:25
  • Does this answer your question? [Providing username with email when using Git clone](https://stackoverflow.com/questions/29356020/providing-username-with-email-when-using-git-clone) – Vahe Yavrumian Aug 30 '22 at 21:12

1 Answers1

19

Use url-escaping, i.e. replace @ in the username with %40:

http://me%40domain.com@myrepo.git
kan
  • 28,279
  • 7
  • 71
  • 101