Skip to content

Contribute to BrainGrid open source project

Jewel edited this page Sep 29, 2017 · 2 revisions

Fork and clone BrainGrid

First, if you are new to Github, get your Github account ready and follow the below steps to download BrianGrid. You can also go over our Git Crash Course for some useful tips.

  1. To fork a repo, navigate to the BrianGrid Github page and click on the Fork button

  2. Open terminal and go to the directory you plan to have BrainGrid placed. For example, you can place it under your home directory $ cd ~

    $ cd YOUR_PREFERED_PATH
  3. To clone the forked repo to your local machine: How

    $ git clone https://github.com/YOUR_USERNAME/BrainGrid.git

Now that you have the entire BrainGrid repository, including all open branches. By default you will be on the master branch which is the most recent version (might be unstable). If you are a user, this should be the right branch for you. If you are a collaborator and wish to work on specific part of the BrainGrid, check out to your desired branch or create a new branch.

Keep your forked BrainGrid in sync

If you are forking the BrainGrid that is currently under development, you will want to sync your forked repo with our original repo from time to time to keep it up-to-date (Why). Here is how to set up origin & upstream to keep your forked repo in sync:

  • List the current configured remote repository for your fork.

    When a repo is cloned, the default remote origin is your fork on Github, not BrainGrid repo it was forked from.

    $ git remote -v 
    origin  https://github.com/YOUR_USERNAME/public_html.git (fetch)
    origin  https://github.com/YOUR_USERNAME/public_html.git (push)
  • Set BrainGrid as your new remote upstream in order to keep your local copy in sync with the BrainGrid.

    $ git remote add upstream https://github.com/UWB-Biocomputing/BrainGrid.git
  • Verify the new remote repository you've specified for your fork.

    $ git remote -v
    origin  https://github.com/YOUR_USERNAME/BrainGrid.git (fetch)
    origin  https://github.com/YOUR_USERNAME/BrainGrid.git (push)
    upstream        https://github.com/UWB-Biocomputing/BrainGrid.git (fetch)
    upstream        https://github.com/UWB-Biocomputing/BrainGrid.git (push)

    if you want to see more detail, do:

    $ git remote show origin
    $ git remote show upstream
  • Syncing your fork by fetching from upstream BrainGrid repo: How

    $ git fetch upstream

    Merge the changes from upstream/master into your local master branch

    $ git checkout master
    $ git merge upstream/master

Now your fork's master branch is in sync with the latest BrainGrid repo without losing your local changes. You are now all set to use BrainGrid.