Daniela Gavidia
posted this on April 16, 2012 11:45
It all depends on how you created your project. First, have you linked your Cloud9 account with your GitHub account? You can check that by going to the Dashboard and seeing if it is activated under Add-on Services (you can see how to link your GitHub account here).
Now, if the Cloud9 account and the GitHub account are linked, you can just create a new repository in GitHub and then just clone from url in Cloud9 (choose Clone from url in the Dashboard). This will create a project in Cloud9 that is already linked to the repository on GitHub, so you should be able to go to the console and just do a 'git push' to update the GitHub repo.
Alternatively, you can create the Cloud9 project first (by going to the Dashboard and choosing Create a New Project). The new Cloud9 project is not yet linked to a GitHub repo. The next step is to go to GitHub and create a repo for your project. Then, follow the instructions on GitHub (we also have some instructions in the README.md file included in any new Cloud9 project). In short (in the Cloud9 console):
git remote add origin git@github.com:C9Support/testPush.git
git add .
git commit -m "First commit"
git push -u origin master
Personally, I prefer to create a repo on GitHub first, clone it and then I just add, commit and push files to GitHub. However, if you created the project in Cloud9 first, you just need to create a matching repo for it on GitHub and add a remote on the console. From that point on, the procedure is the same.
Comments
I signed up using my github account, and created a project on cloud9 and then tried to commit to github (i.e., the alternative way) but when I try push my changes I get the following error:
You can find your SSH key on your Cloud 9 Dashboard, on the right of the screen under "Account Settings". Copy that and paste it into a new SSH entry on your GitHub account at https://github.com/settings/ssh.
I was able to clone a repo from github.
But when trying to push to github an error occurs "WARNING: UNPROTECTED PRIVATE KEY FILE!"
How can I fix this?
I get the same issue
Same issue while trying to push code to github after creating the project in C9 then doing a git init with the console.
Verified that the SSH key from C9 is in my github and that it's pulling the github projects (show as active on dashboard).
When clicking the Github icon on the dashboard (although active) it shows: Error: Assigning a wrong UID to this session
When trying to push I get: error: The requested URL returned error: 403 while accessing
Seems that the wrong keys are being used?
*Some updates may be coming through, as during this comment the dashboard went completely offline with no server response
Solved!
I opened up my project on a computer running Ubuntu and was able to push fine there. After that I was able to push on the windows xp computer.
Calvin,
The issue is not pushing from a remote computer, but rather pushing from C9 directly
TechniX,
To clarify after pushing from within c9 on the Ubuntu computer and then I was able to push from within c9 on the Windows XP computer
Lucky you - I'm still getting:
I'm getting the same error:
/workspace$ git push -u origin master
I was getting same error when using HTTP URL to clone the repo, but it just worked like charm when cloning the repo from SSH URL.
I confirmed that updating the url to use the SSH version instead of https version worked. Both should really be supported though.
If you already had the 'origin' remote declared for your project, you can simply update its url by running the following:
git remote set-url origin <new-url>
eg: git remote set-url origin git@github.com:MyGitUserName/c9.git
I am getting this error when try this process, error: cannot run $HOME/bin/ssh: No such file or directory.
I get this using the clone from github method (see attached screenshot) or creating the cloud 9 project first.
What is going on here?
Follow up to my last commit. When I closed the workspaces and refreshed my dashboard page everything worked as expected.
Cloud 9 seems to have a lot of these issues.
Of course, that assumes you don't find all the others that don't do that.
error: The requested URL returned error: 403 Forbidden while accessing https://github.com/fm75/fm-1.git/info/refs
@Fred Mitchell - Not sure what instructions you're missing, but they are exactly as Github describes them when you first created your github project.
The url to your git should btw be: https://github.com/fm75/fm-1.git not https://github.com/fm75/fm-1.git/info/refs
git clone https://github.com/fm75/fm-1.git
Sometimes using the ssh version works better:
git clone git@github.com:fm75/fm-1.git
One of the big things is to make sure that your keys are properly in github provided by c9, or that you linked your account, if you need to push back to it.
If not you wont be able to read AND write