Prerequisites

To submit code for this project, you must:

  • have git installed on your local computer
  • have a GitHub account

1. Fork our repository

  • Navigate to the source code for this repository
  • Fork the repository into your own account:

  • You can leave the defaults unless you want to change them
  • When you are ready, click Create Fork


2. Clone your repository on your local computer

  • Navigate to your copy of the Simulation repository on GitHub
  • Click the Code button to drop down the code options
  • Copy the URL of your repository (or click the copy icon)

  • Open a Terminal
  • In the terminal, navigate to the directory where you would like to clone the Simulation repository
  • Clone the repository using git clone
    cd /path/to/repository
    git clone <url> # paste the repository URL here
    

    You should see the following output:

    Cloning into 'Simulation'...
    remote: Enumerating objects: 151, done.
    remote: Counting objects: 100% (151/151), done.
    remote: Compressing objects: 100% (111/111), done.
    remote: Total 151 (delta 38), reused 134 (delta 24), pack-reused 0
    Receiving objects: 100% (151/151), 662.95 KiB | 5.10 MiB/s, done.
    Resolving deltas: 100% (38/38), done.
    

3. Create a branch and add your code

  • Navigate to the Simulation repository
    cd Simulation
    
  • Create a branch called your site ID. For example, if your site is named site01:
    git checkout -b site01
    

    You should see the following output:

    Switched to a new branch 'site01'
    
  • Create your site’s code directory. For example, if your site is named site01:
    mkdir -p code/site01
    
  • Copy your code into your site’s code directory.
    When complete, your code directory tree should look like (you may include more than one code script):
    code
    └── site01
      ├── site01_code.py
    
  • Add your code to the staging area. For example, if your site is named site01:
    git add code/site01/*.py
    
  • Commit your code files. For example, if your site is named site01:
    git commit -m 'add site01 code'
    

    For our example site, you should see the following output:

     3 files changed, 0 insertions(+), 0 deletions(-)
     create mode 100644 data/site01/site01_code.py
    
  • Push your local repository to remote. For example, if your site is named site01:
    git push origin site01
    

    For our example site (and for user dmoracze, who is writing this tutorial), you should see the following output:

    Enumerating objects: 6, done.
    Counting objects: 100% (6/6), done.
    Delta compression using up to 16 threads
    Compressing objects: 100% (3/3), done.
    Writing objects: 100% (5/5), 359 bytes | 359.00 KiB/s, done.
    Total 5 (delta 1), reused 0 (delta 0), pack-reused 0
    remote: Resolving deltas: 100% (1/1), completed with 1 local object.
    remote:
    remote: Create a pull request for 'site01' on GitHub by visiting:
    remote:      https://github.com/dmoracze/Simulation/pull/new/site01
    remote:
    To https://github.com/dmoracze/Simulation.git
     [new branch]      site01 -> site01
    

4. Create pull request

  • Navigate to the main Simulation repository’s pull requests and click New pull request

  • Click compare across forks to find your branch

  • Select that you want to merge the branch you created into the Simulation repository’s main branch.
    For our example site (and for user dmoracze):

  • Click Create pull request
  • Fill out the prompts in the Add description box
  • Click Create pull request

Back