How to push an existing Cloud9 project to GitHub

I enjoy the Cloud9 IDE, but their “How do I push my Cloud9 project to GitHub” support article is, when pushing existing code to a new repository, pretty much entirely unhelpful.

If you take the time to read down to the comments you’ll eventually figure out the right way to do it, but it’ll take a while. Here’s the run down:

  1. In the bottom left of your C9 dashboard is a section called “Add-on Services”. Click “activate” next to the “GitHub” icon (if you haven’t already).
  2. When the pop up appears, tell it to allow access to your account. This should complete the link between GitHub account and your C9 account.
  3. While still on the dashboard, look to the right under “Account Settings” for the link “Show your SSH key”. Click on it, and copy the value which appears.
  4. Go to the GitHub SSH settings page, and click “Add SSH Key”
  5. Enter the title “C9”, paste the SSH Key into the “Key” box, and click “Add Key”.
  6. Create a new, empty repository for your project.From your repository’s home page, copy the SSH link. By default GitHub shows the HTTPS link, you will need to toggle it to ssh first!It will look something like:
    "git@github.com:yourname/yourrepository.git".
  7. Open your C9 project window, and go to the terminal.Set your git config username:
    git config --global user.name "Your Name Here"
  8. Set your git config email (which should match your github account email):
    git config --global user.email "your_email@example.com"
  9. Make your current directory a git repository by running:
    git init
  10. Using the SSH link you copied in step 7, add the remote repository as the origin:
    git remote add origin git@github.com:yourname/yourrepository.git
  11. Add your files and commits, as you normally would:
    git add .
    git commit -m "First commit"
  12. Push your changes:
    git push -u origin master
  13. Admire your updated repository on GitHub

So yes, there’s a bit of mucking around. The alternative is, of course, that you create the empty repository on GitHub first, then create a new C9 project using the “check out new project” functionality. In future, I think I’ll probably try that method instead.

25 thoughts on “How to push an existing Cloud9 project to GitHub

  1. Pingback: How to push C9.io development code to GitHub? | coded to dna

  2. Hi,
    I want to push my project to github from cloud 9, but I don’t see “Add-on-Service”, any help is appreciated. I need to push it asap.

    Thanks
    In the bottom left of your C9 dashboard is a section called “Add-on Services”. Click “activate” next to the “GitHub” icon (if you haven’t already).

  3. It’s now under the settings space (circle with a gear icon in the top right). It’s called “Connected Services”, rather than “Add-on Services”.

  4. Pingback: Quora

  5. Pingback: Cheatsheet: GIT | JuniorSamaroo - Please don't hack me :)

Leave a Reply

Your email address will not be published. Required fields are marked *

*