This guide explains how we use Bitbucket to get code, check code in, merge, branch, and do code reviews. This is NOT a git tutorial. Read https://www.atlassian.com/git or the tutorial of your choice to get comfortable with git.
Get (clone) the repository the first time:
- Open the project in Bitbucket
- Click on the repository of interest. Then click the 'Clone' button. You should see an https URL. Remember this URL.
- Go to the machine where you want the. Create a directory for the repository.
cdinto your new repository.
- type '
git clone https://the_url_from_step_2.com'. You will be prompted for your ECC password.
Create a branch for a code change that will be reviewed:
*** NOTE: Code reviews are done when you merge one branch into another. So you must create a branch to enable code reviews. ***
- Create a ticket in JIRA for your code change. Go to that ticket. You'll see a "Create branch" link on the right under 'Development.'
- Click 'Create branch'. You'll get a new page with the branch information:
- Make sure you are branching the right repository!
- Make sure you are branching from the correct branch!
- Click the 'Create branch' button.
- You should see the branch in in the ticket:
- You should also see the branch in stash
- Make sure you pull these repository changes from stash, change to the correct branch, and check your code in there.
Get your code reviewed before merging into the main branch
- Make sure you've pushed your branch changes to stash. You should see some new commits for the branch in stash:
- Create a pull request. Click the 'Pull Request' button on the upper right:
- Select the the source branch and the destination branch:
- Make sure to specify a reviewer in the 'Reviewers' section:
- Click the 'Create pull request'.
Reviewing someone else's pull request
- You will be be notified via email when you are a reviewer. You can find pull requests under the 'Pull requests tab of the the Bitbucket website
- Review the differences. Add comments if you think there are things that need to be fixed. You can decline a merge if more changes need to be made.
Reopening a merge request
Fixes that are checked in won't show up in a declined merge request. You don't need to create a new merge request, however. You just need to reopen the one you have once your fixes have been checked into the appropriate branch. The new diff will show your updates.
Merging after review
Once you are done reviewing the code, it's time to merge.
There is no content with the specified labels