-
Notifications
You must be signed in to change notification settings - Fork 17
Contribute to BrainGrid open source project
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.
-
To fork a repo, navigate to the BrianGrid Github page and click on the Fork button
-
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
-
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.
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 localmaster
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.
If you want to make changes and contribute to BrainGrid, we strongly recommend creating new branches on your end. This would make it easier for us to track changes and collaborate with other people.
-
List all branches in the repo
$ git branch
-
Create a new branch to work on Why
$ git checkout -b YOUR_BRANCH_NAME [BASE_BRANCH_NAME]
(Note: BASE_BRANCH_NAME is optional and defaults to master)
-
Commit and push the changes you made locally to your own Github repository
$ git status $ git add FILE_NAME $ git commit -m “MESSAGE” $ git push -u origin YOUR_BRANCH_NAME
-
Open a pull request when you are ready to let us know about the changes you've pushed to your repo on Github: How
- Go to your forked BrainGrid repo page on GitHub.
- Click on Pull Request button in the repo header
- Click on the Head Branch dropdown and pick the branch you wish to merge with.
- Enter the title and description for your pull request.
- Lastly, click on the green Send pull request button.
- Once a pull request is sent, collaborators can review and discuss the changes you made.