Skip to content
Freddy May edited this page Jun 9, 2017 · 9 revisions

Feel free to edit this to provide information on how to collaborate on C5 content.

Associating your Codio account with GitHub

Video : https://vimeo.com/220215355

You need to do this once only. This uploads the public key for your account (and for any Codio box that your create) to GitHub. This prevents you having to enter a user name and password whenever you have to push changes to GitHub.

  • In Codio, click on your user name in the bottom left of the main Codio dashboard.
  • In the next screen, click on the Applications tab in the top bar.
  • The GitHub section should appear at the top. First click on Connect account.
  • Next, click on Upload public key.

Creating a brand new project

Video : https://vimeo.com/220290422

I suggest that this is done by Anne always, although it is not strictly necessary. It is only done once. If someone else has already created the new Codio project, then please refer to the section below Creating a Codio project from a GitHub repo.

  • Create a new project in Codio. I suggest you use the Python stack for the time being until we decide on a final stack.
  • Edit the new project if you like (not necessary).
  • When ready to link the Codio project to GitHub, go to https://github.com/codio-c5
  • Create a repository in GH by pressing the New button.
  • Give the new repo a name.
  • On the next screen, press the SSH button
  • Copy the link lower down that looks something like git remote add origin git@github.com:codio-c5/test-project.git
  • Back in Codio, open a new terminal window from the Tools->Terminal window.
  • Enter git init to initialise a repository on the Codio box.
  • Paste in the copied link that looks something like git remote add origin git@github.com:codio-c5/test-project.git and press enter. A this point, the Codio Box is properly linked to the GitHub repo.
  • On the command line, enter git add -A. This tracks all new files in the repo.
  • then git commit -am 'some useful text that summarises this commit. This adds all changes in all tarcked files to the repo.
  • Finally, enter git push origin master --set-upstream. This pushes the committed files to the GitHub repo.

You can now carry on working in your Codio project (see The normal workflow below).

Creating a Codio project from a GitHub repo

Video : https://vimeo.com/220290441

If someone else has already set everything up, you should create your Codio project from the GitHub repo and not by creating a new project within Codio.

  • Go to https://github.com/codio-c5
  • Locate the project that you want to work on in Codio and click on it.
  • On the right hand side is a green button Clone or download. Click on it.
  • The little popup should be titled Clone with SSH. If it says Clone with HTTPS then click on the Use SSH link to the right.
  • Copy the link to the clipboard using the icon
  • Go to Codio and create a new project
  • In the Section 1 area, look for Want more options? Click here and then click on click here.
  • Click on the Import section if not already selected.
  • Paste in the url you copied from GitHub.
  • Create the project.
  • You can now make the changes to you project. Please refer to The normal workflow below to see how to push changes to the GitHub repo once you start editing the Codio project.

The normal workflow

VIdeo : https://vimeo.com/220290405

Once you have your project set up and it is linked to the GitHub repo, you should follow these steps.

  • Open a terminal window
  • Start working on your Codio project
  • After doing a chunk of work, you should commit and push your changes. Don't wait days to do this. Do it regularly!!!
  • Enter git add -A to add any new files you may have created.
  • Enter git commit -am 'some useful text that summarises this commit.
  • Enter git pull to pull in other people's changes. If you get a conflict warning, see the section below on how to resolve.
  • Enter git push to push your changes up to the GitHub repo.

Conflict Resolution

It will happen that two people work on overlapping bits of text. In this case, Git will not know how to automatically resolve the conflict and you will need to help.

I will add a video asap.

Fixing the permissions error when pushing/pulling

Please see this video : https://screencast.com/t/womQk3DICQ