Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      Sunshine And March Vibes (2025 Wallpapers Edition)

      May 16, 2025

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      May 16, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      May 16, 2025

      How To Prevent WordPress SQL Injection Attacks

      May 16, 2025

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025

      Bing Search APIs to be “decommissioned completely” as Microsoft urges developers to use its Azure agentic AI alternative

      May 16, 2025

      Microsoft might kill the Surface Laptop Studio as production is quietly halted

      May 16, 2025

      Minecraft licensing robbed us of this controversial NFL schedule release video

      May 16, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      The power of generators

      May 16, 2025
      Recent

      The power of generators

      May 16, 2025

      Simplify Factory Associations with Laravel’s UseFactory Attribute

      May 16, 2025

      This Week in Laravel: React Native, PhpStorm Junie, and more

      May 16, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025
      Recent

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025

      Bing Search APIs to be “decommissioned completely” as Microsoft urges developers to use its Azure agentic AI alternative

      May 16, 2025

      Microsoft might kill the Surface Laptop Studio as production is quietly halted

      May 16, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»Beginner’s guide to GitHub: Creating a pull request

    Beginner’s guide to GitHub: Creating a pull request

    August 12, 2024

    Welcome back to GitHub for Beginners, a series designed to help you navigate GitHub with ease.

    So far in this series, we’ve covered the top Git commands every developer should know, how to create repositories, how to upload files and folders to your repository, and how to add code to your repository. In our most recent entry, we talked briefly about pull requests, but now we’re going to dive into them at depth. This entry is dedicated to showing you how to create a pull request so you can suggest changes to a repository and have others review those changes before committing them.

    Let’s get started!

    What is a pull request?

    A pull request (often referred to as “PR”) is a proposal to merge a set of changes from one branch into another. By creating a pull request, you can review a set of changes with others before they are incorporated into the main code base. Before getting to that, it’s helpful to define a couple of terms.

    Source branch: the branch containing your changes.
    Target branch: the branch you are trying to merge your changes into.

    Pull requests provide a visual representation of the differences in the content between the source branch and the target branch. This is what enables you to review the changes before accepting them and pulling them into the target branch.

    Creating your pull request

    You can create a pull request on GitHub.com with GitHub Desktop, GitHub Codespaces, on GitHub Mobile, and when using the GitHub CLI. You can also create a pull request from the terminal using git, which is what we’ll do here.

    On GitHub, navigate to your repository, clone it, and create a new branch. If you need a refresher for any of these steps, refer to the earlier GitHub for Beginners entries. For the purposes of this walkthrough, we created a new branch in our repository called update-name. After creating this branch, open your terminal and run git checkout -b update-name to navigate to the update-name branch.

    Open a file in the repository in your editor, and make a change. In our case, we made a change to the index.html file. Don’t forget to save the file!

    Stage and then commit your changes by running the following commands in the terminal:

    git add .
    git commit -m “update game name”

    Once these commands are complete, run git status to ensure that the changes were successfully committed. If they were, you should see a message indicating that there is nothing to commit and your working tree is clean. Awesome!

    Now you will need to push your changes to the repository on GitHub. You do this by running git push origin update-name in the terminal. Remember that if you used a different name for your branch, you will need to replace update-name with the name of your branch: git push origin your-branch-name.


    https://github.blog/wp-content/uploads/2024/08/2-push-code.mp4#t=0.001

    Navigate to GitHub, and you should see a message indicating that your branch had recent pushes a short while ago. Click the green button that says “Compare & pull request.” This will take you to the pull request page, where you can enter the information for your pull request.

    In the top left of the page is a dropdown button that says “base:” followed by a branch name. Most likely, this will say “base: main.” This indicates the branch that you want to merge the changes into, otherwise known as the target branch. Click the button and select “main” if it isn’t already selected.

    The dropdown box to the immediate right of the “base:” box is the “compare:” box. This indicates the branch that you are merging from, otherwise known as the source branch. Click this box and select the branch where you made your changes.

    https://github.blog/wp-content/uploads/2024/08/4-openpr-branches.mp4#t=0.001

    After making sure the target and source branches are set correctly, add a title and a description for the pull request. The description should explain the changes that you made. If you are not ready for your changes to be reviewed, you can create a draft pull request. Or you can create a pull request for review by pressing the green “Create pull request” button. Do that now.

    Congratulations! You’ve created your pull request! Now, you can have someone else on the team review your changes. Once they have provided a review, you can merge your changes into the target branch by clicking the green “Merge pull request” button at the bottom of the page.

    Things to keep in mind

    When you create pull requests going forward, here are a few best practices you should keep in mind.

    Write small pull requests. Smaller pull requests are easier and faster to review and merge, provide less room to introduce bugs, and provide a clearer history of changes.
    Review your own pull request first. Review, build, and test your own pull request before submitting it. This will allow you to catch errors or typos that you may have missed before others start reviewing it.
    Provide context and guidance. Write clear titles and descriptions for your pull requests so reviewers can quickly understand what the pull request does. You should include the following in the body of your pull request:

    The purpose of the pull request
    An overview of what changed
    Links to any additional context such as tracking issues, tickets, or previous conversations

    Your next steps

    Now that you can create pull requests, you can use this repository to practice creating them. Once you feel comfortable creating pull requests, you have the power to suggest changes to existing repositories and offer your own contributions for consideration. It’s an excellent way to collaborate, so give it a shot!

    If you have any questions, pop them in the GitHub Community thread and we’ll be sure to respond.

    Here are some more resources to help you on your GitHub journey:

    GitHub Foundations Certificate
    About pull requests
    Creating a pull request
    Merging a pull request
    Requesting a pull request review

    The post Beginner’s guide to GitHub: Creating a pull request appeared first on The GitHub Blog.

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleNow in Baseline: animating entry effects
    Next Article HTML Attribute to Allow/Disallow Handwriting Input

    Related Posts

    Security

    Nmap 7.96 Launches with Lightning-Fast DNS and 612 Scripts

    May 17, 2025
    Common Vulnerabilities and Exposures (CVEs)

    CVE-2024-47893 – VMware GPU Firmware Memory Disclosure

    May 17, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    Santander Confirms Data Breach, Assures Customers’ Transactions Remain Secure

    Development

    Using the Web Audio API to simulate various sets of tuning forks.

    Development

    CVE-2025-2775 – SysAid On-Prem XXE Remote Code Execution

    Common Vulnerabilities and Exposures (CVEs)

    A Complete Guide to Creating Summary Reports in Salesforce

    Development
    GetResponse

    Highlights

    Jump from B2C to B2B product management

    June 4, 2024

    The worlds of B2B and B2C product management have long been viewed as inherently different.…

    7 Top Starter & Barebone Themes for WordPress Development

    April 15, 2025

    Your Roku TV is getting several free updates – including a big one for Roku City

    April 23, 2025

    CVE-2025-4751 – D-Link DI-7003GV2 Information Disclosure Vulnerability

    May 16, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.