Forums/Using Cloud9 IDE/How To

Push your (git) Cloud9 project to Bitbucket

Daniela Gavidia
posted this on December 07, 2011 15:07

In this article, I will explain the steps you have to take to push a Cloud9 IDE project to a source code hosting site like Bitbucket. For this article, I'm assuming that you have created a git project in Cloud9. Let's see how you can push this project to Bitbucket.

First, if you haven't done so already, create a Bitbucket account. Then, follow these steps:

  1. Go to your Cloud9 dashboard. Click on Your Account  and, under Account Settings, click on Show your SSH key and copy the key.sshKey.png.
  2. In Bitbucket, go to Account Settings and then click on SSH Keys (https://bitbucket.org/account/#ssh-keys). Paste the Cloud9 SSH key into the textbox. Then, click "Add key".
  3. Create a git repository on Bitbucket. At the top, you will see: "Clone this repository (size: ... bytes): HTTPS/SSH". Click on SSH. Then, underneath it will show a URL of the form git@bitbucket.org:username/reponame.git. Copy this URL.cloneBitbucket.png
  4. Go to your Cloud9 project. If you created it as a git project, git is already setup. If you haven't already, commit any changes using the console:
    • git add .
    • git commit -a -m "My first commit"
  5. Then, add a new remote repository from the Cloud9 console:
    • git remote add origin <git url you copied>
    • For instance:
    • git remote add origin git@bitbucket.org:username/repository_name.git
  6. Then, you can push to this repository:
    • git push origin master

Your project is now pushed to bitbucket.

 

Comments

User photo
Robert Craven

I think I followed these directions accurately but only one file of the project made it to bitbucket

January 13, 2012 21:53
User photo
Matt Pardee
Cloud9 IDE, Inc

It is possible that "git add ." took a bit longer than expected and thus all your files weren't transferred. Be sure to wait a few seconds for git add . to complete (you can type `git status` into the console to see if your files were added). Then pushing will work as you expect.

February 23, 2012 08:35
User photo
Harry Kaimenas

I was getting an error when trying git commit -m "Initial commit". To make it work I had to escape the space character like that:

git commit -m "Initial\ commit".

 

Hope that helps.

June 28, 2012 10:13
User photo
Momentum

I walked through these steps and it showed up a prompt asking for password ... what should I do?

October 25, 2012 04:49
User photo
Momentum

Never mind, my SSH Ket was not set. All set now !

October 25, 2012 17:18