3

One of the formats for pushing to git on command line is

Url format:
    https://{username:password@}github.com/{owner}/{repo}

My challenge is the username and password - which are for a shared account I do not control - contain the @ within them (both actually ..)

What would be my options in this case (and not to change the username, password - that will take some additional administrative/coordination steps).

WestCoastProjects
  • 58,982
  • 91
  • 316
  • 560
  • Maybe [this](http://stackoverflow.com/questions/4457009/special-character-in-git-possible) will help. For reference, could you show us an actual command which is failing? – Tim Biegeleisen May 26 '16 at 02:38
  • Consider finding a way to access the account that doesn't require including the password as plain text in a URL. – Keith Thompson May 26 '16 at 02:46

2 Answers2

11

Try percent-encoding the @ characters:

https://usern%40me:p%40ssword@github.com/owner/repo
rob mayoff
  • 375,296
  • 67
  • 796
  • 848
  • Note: if used within a batch file the %-character need to be escaped too. so the string would look like this: https://usern%%40me:p%%40ssword@github.com/owner/repo – Tom Jan 29 '20 at 14:14
3

Would url ecoding work? Eg @ = %40

Ref Url encode

Ps different languages encode @ differently. (Eg Javascript)

All the best