2

Ionic Pro uses git to get access to the code you write in order to clone it in their cloud service - This is done so they can build your app on your behalf. An extract from their documentation:

Ionic Pro uses git to manage new app builds, push app updates, and more.
Before using Ionic Pro's git workflow, you must add a valid SSH key to your 
account.

Ionic Pro's git service is not a replacement for your source code management 
service of choice, such as GitHub or GitLab.

I would like to draw attention to the line: Before using Ionic Pro's git workflow, you must add a valid SSH key to your account.. Ionic is nice enough help you with this if you do not have one already and generate one for you and link it up to your account, which I did. So thus far I can do some work and then commit and push my changes to the ionic git (to start the cloud build) using git push ionic master; no issues.

I am now done prototyping and want to start serious development and add the project to my own Github repo. So i tried running git remote add origin git@github.com:AccountName/AppName.git. This executed without a problem. However, when I tried to run git push -u origin master, i get the error fatal: Authentication Failed. Since Ionic setup the repo, it also setup the SSH keys used for authentication, but I have no idea how that process actually works. Currently my git bash environment is setup with my Github account set to my username and password, but I dont know how to link this SSH based repo to my Github username:password based repo. I used Git Bash and copied my public SSH Key into my GitHub SSH Keys:

enter image description here

And this is also the only public SSH key on my machine:

enter image description here

enter image description here

However I am still getting this error if I try to run git push -u origin master:

enter image description here

Marnus Steyn
  • 1,053
  • 2
  • 16
  • 44

1 Answers1

1

However I am still getting this error if I try to run git push -u origin master:

That is because your SSH URL does not take advantage of your ssh/config file, which does reference the ssh/ionic/private_key path.

That config path should have an Host entry, say Host ionic.
In that case, modify your SSH url:

git remote set-url origin ionic:AccountName/AppName.git

(not git@github.com here: everything is specified in ssh/config, under the Host entry, as in this example)

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250