By default, you will be on “master“ branch. Create a new branch based on the “master“ branch. Use a name starting with the issue ID, such as, “SW-4”. This allows Jira hook the branch link in the issue page.
git branch # make sure you are on master branch
git checkout -b [name_of_your_new_branch] # create a new branch
You will work on the issue/task and commit your code into the created new branch. Use commit message starting with issue ID, such as “SW-4. fix…“, allows Jira system hook the commit link in the issue page.
Create a pull request
When you resolve your issue or finish the task, make sure you have commit all your work to the branch and push the changes to GitHub with following command
git push origin [name_of_your_new_branch]
Go to https://github.com/[GitHub Account]/demo_github_jenkins_repo in a browser
Select your branch in the branch drop box on the left side of the page
Click “New pull request“ button next to the branch drop box
Make sure the target branch is https://github.com/changtengfei/demo_github_jenkins_repo:master
Review the changes and click “Create pull request“ when you are satisfied with your changes.
Go to the issue page and change the STATUS to RESOLVED
Go to the “Pull Requests” Tab and open the PR you would like to review
At the bottom of the “Conversation” page, the status shows the checks status by the Jenkins builder. The PR can only be merged when all checks passed unless you do know what is the consequence to merge the PR that doesn’t pass the checks.
The “Files changed“ pages detailed the changes made by the PR. Review and comment about the changes before merging
Keep discussing any changes related to the code on the GitHub site to track the story
Merge the code
When both Admin and developer(s) agree there is no further changes required to the PR, you can click the green “Merge pull request“ button to merge the PR
Go to the linked issue page, close the issue by change the STATUS to CLOSED