2

I am using Codenvy for my rails app. When I run git push -u origin --all with my rails application i get a blank terminal. When I push using the Git > Remotes > Push menu, I get the error "Can't store ssh key. Unable get private ssh key."

Is this a problem with OAuth, because I have not set that up yet. I tried following the Codenvy git documentation, but they provided no info on what to fill into the <HOST_IP>, <SERVER_PORT>, <CHE_HOST_IP>, yourClientSecret, and yourClientID parameters. I have followed many online tutorials trying to connect my Codenvy App to GitHub, and none of them have been successful. I cannot seem to find one definitive way to do this. I am new to Codenvy, so could you please explain this to me?

Reproduction Steps: I have already:

  • Added my Git user info to my preferences
  • Added my GitHub info using git config --global user.name/email "name/email"
  • Added my remote origin with my repository name using git remote add origin git@bitbucket.org:/
  • Generated an SSH key using VCS under the host name "github.com" and added the public ssh to my GitHub account

UPDATE: I have fixed by git origin and now when I run git push -u origin -all, I get the following error:

! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://github.com/Git-Ibraheem/toy_app.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

When using the Codenvy Git menu, I get the same error:

failed to push 'master -> master' to 'https://github.com/Git-Ibraheem/toy_app.git'. Try to merge remote changes using pull, and then push again.

When I run git pull origin master I get the following:

error: Pulling is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.`

Fix: I ran the command git reset --hard HEAD and then git push -u origin --all. This was succesful!

Ibraheem Ahmed
  • 11,652
  • 2
  • 48
  • 54

1 Answers1

2

using git remote add origin git@bitbucket.org:/

That should be a full URL git@bitbucket.org:/MyAccount/MyRepo

Generated an SSH key using VCS under the host name "github.com" and added the public ssh to my GitHub account

That... would have nothing to do with bitbucket then (which you just mentioned as your "origin").

Is this a problem with OAuth,

If you are using SSH, OAuth is not involved, so no.

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