Skip to content

Instantly share code, notes, and snippets.

@Zsailer
Last active August 29, 2015 14:24
Show Gist options
  • Save Zsailer/f059402dd8989528e159 to your computer and use it in GitHub Desktop.
Save Zsailer/f059402dd8989528e159 to your computer and use it in GitHub Desktop.

Creating an open source D3-Backbone app on Github

Github is where you'll host all your projects publically. It's the platform we'll use to write and share applications, and it allows us to work on these projects in parallel. It will make it easier for me to help you, since all your code is availabe for me to oversee online.

Getting started.

Navigate to the directory where you'd like to keep all your projects. The commands below will download the boilerplate code and prepare it for development. Anytime you see <project_name>, replace it with whatever name you're like to give the project (no spaces!).

git clone https://github.com/Zsailer/d3app <project_name>
cd <project_name>
git submodule init
git submodule update
git remote rm origin

Now we need to create a repository on Github for hosting this project.

  1. Go to Github
  2. Click on the "+ New repository" button.
  3. Name the repository the same as your <project_name>
  4. In Description, write a short description of the application you're writing.
  5. Make sure the Public bubble is selected.
  6. Do not initialize this repository with a README.
  7. No .gitignore or licence is necessary.
  8. Click Create repository
  9. Once the repo is created, copy it's URL.

Go back to the command-line in the directory of your <project_name>, and enter the following commands, replacing <project-url> with the URL you copied from Github.

git remote add origin <project-url>
git push origin master

Sharing changes with Github.

After you've made some changes to the code, you'll want to update the Github repo with these changes. This is known as committing your changes. We need to let Git know what changes we'd like to commit.

To see what files you've changed, type on the commandline:

git status

You'll see all files that have changes. Some might be listed as untracked files. For now, we'll tell Git that we want all files to be committed. For each file path, use the following command to add these changes (don't forget to put the file path in quotes).

git add "<file-path>"

Once you've done this for all files, type the following command with a message in quotes

git commit -m "some SHORT message describing the changes you made"
git push origin master

That's it! This will set you up on Github and allow you to begin sharing projects immediately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment