2

I am using GIT_REPO_URL="https://$GIT_ACCOUNT:$USER_PW@github.com/XXXX/xxx" syntax.

Lately I have changed my password so it ends by @.

For example my password is 123456789@.

When I input my password it says. Couldn't resolve host '@github.com' Basically the repo url is now equal to GIT_REPO_URL="https://myAccountName:123456789@@github.com/XXXX/xxx".

Does anyone know, how to solve this problem?

MrTux
  • 32,350
  • 30
  • 109
  • 146
John
  • 71
  • 8

2 Answers2

7

You have to "URL encode" the username and password. See https://www.rfc-editor.org/rfc/rfc3986 for percent encoding.

@ will be encoded as %40, so the url would look like: https://myAccountName:123456789%40@github.com/XXXX/xxx

Here is a tool for this: http://meyerweb.com/eric/tools/dencoder/ or just use an ASCII table ;).


Alternatives would be to use a git store for storing credentials, use the .netrc file, or use SSH keys.

Community
  • 1
  • 1
MrTux
  • 32,350
  • 30
  • 109
  • 146
3

Why not switching to ssh and get rid of the passwords?


Simply follow those steps and you will set up your ssh key in no time:

  • Generate a new ssh key (or skip this step if you already have a key)
    ssh-keygen -t rsa -C "your@email"

  • Once you have your key set in home/.ssh directory (or Users/<your user>.ssh under windows), open it and copy the content


How to add sh key to github account?

  • Login to github account
  • Click on the rancher on the top right (Settings)
    github account settigns
  • Click on the SSH keys
    ssh key section
  • Click on the Add ssh key
    Add ssh key
  • Paste your key and save

And you all set to go :-)

Community
  • 1
  • 1
CodeWizard
  • 128,036
  • 21
  • 144
  • 167