Introduction
To develop IGB, we use the Forking Workflow described in https://www.atlassian.com/git/tutorials/comparing-workflows/forking-workflow, but with one difference - we issue pull requests to the development branch, not the master branch.
The following sections describe how to use this workflow to develop IGB.
Setting up
To contribute a change to the IGB code base, create your own fork of the IGB repository.
To create your own fork:
- Sign up for Bitbucket account
- Go to http://bitbucket.org/lorainelab/integrated-genome-browser
- Select Fork
Next, you'll see a form that let's you give your fork a name and description. Here's an example:
Fill in the fields and click Fork repository.
After a moment, the Overview page for your forked repository will appear. Click Settings and change the main branch to the IGB development branch.
See Atlassian documentation Forking a Repository.
Clone your fork
Clone a copy of your forked IGB repository onto your computer. You will make changes to your local clone, commit them to your local repository, and then ultimately push your changes to your fork hosted on Bitbucket.
To clone your fork:
git clone <ADDRESS>
where ADDRESS is the address of your fork on Bitbucket. To get the address of your fork, look at the top the top right of your fork's Overview page on Bitbucket.
Make a branch
Before you start making changes to your local clone, you should first create a new branch for the changes you intend to make. This will allow you to issue focused, low risk pull requests that can be easily merged with other branches of development.
To make a branch:
- First, synchronize your local copy of the code with the latest development branch using git checkout. For example, if the development branch is igb_8_3, you would execute:
git checkout igb_8_3
- Next, create a branch for the changes you plan to make:
git branch -b <BRANCH>
where BRANCH is the name of the branch, e.g., IGBF-203, the name of a story in the IGB JIRA issue-tracking system.
Now, all commits will be associated with the branch you've just created. Commit your changes to your local repo and then push them to your fork hosted on bitbucket.
Issue pull request
To request that your edits be incorporated into the main line of development:
- Go to your fork's project Overview page
- Select Create Pull Request
A pull request form will appear. Fill in the fields:
- Select your branch (see above) as the pull request source (left side).
- Select the current development branch as the pull request target (right side).
- Fill in the Title and Description fields
- Request Reviewers
- Click Create pull request
Keep your fork in sync with the main repository
If the main development branch changes, you should merge in those changes to your fork. Bitbucket has utilities that make this easy - see https://blog.bitbucket.org/2013/02/04/syncing-and-merging-come-to-bitbucket/.
To bring a remote fork up-to-date with a development branch:
- Add the original, main IGB repository as a remote git repo with the alias "upstream"
git remote add upstream git@bitbucket.org:lorainelab/integrated-genome-browser.git
Fetch and merge changes from upstream for a development branch (e.g., igb_8_5) using pull or rebase commands
git pull upstream BRANCH
or
git pull --rebase upstream igb_8_3
- Push these changes back to your fork (aliased to "origin" in this example)
git push origin igb_8_3