Pull & Merge Request in GitHub

  • Estimate Completion Time
    not found 30 minutes
  • Difficulty Level:

Create a pull request and merge all the changes done in the feature test into the main branch. Delete the feature-test branch when all changes are merged from the feature-test branch to the main branch.

Solution

Step 1 - Initiate a New Pull Request

  • Navigate to your repository.
  • Click on the “Pull requests” tab. A new screen displays showing all your open pull requests if you have any.
    Github Exercise - Pull & Merge request
  • Click on the “New pull request” button in green colour.
    Github Exercise - Pull & Merge request

Step 2 - Choose Branches

  • In the base drop-down, choose the name of the branch that is to be “main” you want to merge changes into.
  • In the "compare" dropdown, select feature-test. This is the branch you have changes in and want to merge from.
    Github Exercise - Pull & Merge request

Step 3 - Review Changes

  • All the changes done will be displayed on the screen. GitHub highlights the differences between the two branches to review the changes and ensure they are as you expect.
    Github Exercise - Pull & Merge request
  • If everything is correct, click the green "Create pull request" button.

Step 4 - Fill in the Pull Request Details

  • Provide the title and description for your pull request. This helps your collaborators or even you to better understand why this change is being made and what this comprises.
    Github Exercise - Pull & Merge request
  • Once you've provided the necessary information, click "Create pull request" or you can choose ‘Create draft pull request” to review it from the repository manager.

Step 5 - Merging the Pull request

  • Once the pull request is created, you (or someone else with the necessary permissions) can review the changes one last time.
  • If there are no merge conflicts, then click the green "Merge pull request" button.
    Github Exercise - Pull & Merge request
  • Click the green “Confirm merge” button.
    Github Exercise - Pull & Merge request

Step 6 - Deleting the branch

  • After merging, there is an option available to delete the feature-test branch on GitHub since its changes have been combined into the main branch.
  • Click on "Delete branch”. This helps in keeping the list of branches tidy. Also, leave a comment which helps others to know the purpose of deletion.
    Github Exercise - Pull & Merge request
GitHub Practice Exercises - QA Ads Banner

Proleed Academy

Proleed serves / offers professionally designed IT training courses
globally.

Copyright © 2023 - Proleed Academy | All Rights Reserved.