Table of Contents |
---|
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.
...
See Atlassian documentation Forking a Repository.
Clone your fork
Clone a copy of your forked IGB repository onto your local computer. You will make changes to your local clone, commit them to your local repository, and then ultimately push your changes upstream to your fork hosted on Bitbucket.
To clone your fork, use git clone with the address of your remote fork. (Copy the address from the your fork's Overview page at Bitbucket.)
Make a branch
However, before you get startedBefore 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.
...
Code Block | ||
---|---|---|
| ||
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.
...
To request that your edits be incorporated into the main line of development:
- Go to your forks project over view 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
Bitbucket itself has some utilities which can to help you pull in the latest code when you are working in their web application (see https://blog.bitbucket.org/2013/02/04/syncing-and-merging-come-to-bitbucket/); however, when working locally . However, you will likely want to use the command line to keep your branch in sync with the remote branch you are tracking. How to do this is really The details about how this works are outside the scope of this article; however, we provide a simple example will be provided for your reference.
Example
For our purposes, let's assume we The following example assumes we followed the workflow above and are working on the master branch.
...
a development branch named igb_8_3.
To bring our remote fork up to date:
- Add the original, main IGB repository as a remote git repo with the alias "upstream"
Code Block |
---|
git remote add upstream git@bitbucket.org:lorainelab/integrated-genome-browser.git |
Fetch and
...
merge changes from upstream for the
...
development branch named igb_8_3.
Code Block |
---|
git pull upstream |
...
igb_8_3 |
- Alternatively, you could rebase:
Code Block |
---|
git pull --rebase upstream |
...
igb_8_3 |