This repository (repo) holds the source code for the Brainstorm application.
When contributing, please first discuss the change you wish to make in one of the three following ways:
- A post in the Brainstorm forum (preferred communication method)
- A GitHub issue
- An email to the Brainstorm team
Contributions to this repository include:
- 🪲 Solving Issues
- ❔ Addressing questions in the Brainstorm forum
- ⭐ Development of new features
To know other ways in which you can collaborate with Brainstorm, visit the Contribute page.
Brainstorm is developed with MATLAB (and bit of Java for the GUI). This is a brief list of resources to get started with MATLAB if you are new or come from a different programming language:
- Get Started with MATLAB
- MATLAB Fundamentals
- Introduction to MATLAB for Python Users
- MATLAB for Brain and Cognitive Scientists
- Brainstorm scripting
Before starting a new contribution, you need to be familiar with Git and GitHub concepts like: commit, branch, push, pull, remote, fork, repository, etc. There are plenty resources online to learn Git and GitHub, for example:
- Git Guide
- GitHub Quick start
- GitHub guide on YouTube
- Git and GitHub learning resources
- Collaborating with Pull Requests
- GitHub Documentation, guides and help topics
- And many more...
We use the GitHub Flow as guideline for contributions. Thus, the general process to contribute to Brainstorm consists of 7 steps:
-
Fork the official Brainstorm repo (
https://github.com/brainstorm-tools/brainstorm3
) to your GitHub account. This will create your Brainstorm repo in your GitHub account. Then clone your Brainstorm repo (https://github.com/YOUR-USERNAME/brainstorm3
) to your computer. These actions will create a copy of the Brainstorm repo in your GitHub account and a local repo in your computer so you can freely modify it without affecting the official Brainstorm repo.Fork the official Brainstorm repo in https://github.com/brainstorm-tools/brainstorm3, then:
$ git clone https://github.com/YOUR-USERNAME/brainstorm3
-
In your local repository, add the official Brainstorm repo as a remote.
$ git remote add official https://github.com/brainstorm-tools/brainstorm3
At this point the remote
origin
refers to your forked repo (in your GitHub account), and the remoteofficial
to the repo inhttps://github.com/brainstorm-tools/brainstorm3
. By doing this you can pull the official Brainstorm repository to keep your repo synchronized with the most recent version of Brainstorm.$ git checkout master $ git pull official master $ git push origin master
⚠️ Perform your changes in the latest version of Brainstorm to facilitate the contribution process. -
Create a branch in your local repo. This branch is the one that will be used for your contribution.
git checkout -b fix-something
💡 Make a separate branch for each set of unrelated changes.
-
Your branch is a safe place to make the changes that you desire.
git checkout fix-something
Commit your changes to your local branch.
- Give each commit a descriptive message to help you and the maintainers to understand what changes the commit contains.
- Do not push your commits until you're happy with them, or you have good reason to do it.
💡 Working locally give you the freedom of rewriting your commit history to clean it up. A clean commit history simplifies the contribution process. See: Git tools rewriting history for more info.
-
When you're done the desired changes. The next step is to push your local branch (if you haven't) to your remote
origin
repo.To push your local branch to the remote
origin
for the first time, you need to set the upstream. This process creates a branch in your remote repo, links it to your local branch, and pushes your local changes to the repo in your GitHub account.git push --set-upstream origin fix-something
Once the upstream is set, additional local commits can be push with:
git push origin fix-something
-
Once you're happy with all the changes that you have done, and you have pushed them to your remote repo, using the GitHub website, create a Pull Request (PR) from your remote branch to the master branch in the official Brainstorm repo.
⚠️ For greater collaboration, select the option Allow edits by maintainers before creating your PR. This will allow Brainstorm maintainers to add commits to your PR branch before merging it. You can always change this setting later.
-
Once you have created a PR, we will start a review on the changes and provide feedback to have all the proposed changes inline with Brainstorm. When your PR is approved, the next step is to merge your work to the official Brainstorm repo.
Do not hesitate in contacting us if you have any question.