DZone
Open Source Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Open Source Zone > Learning Git: What Is a Pull Request?

Learning Git: What Is a Pull Request?

Perfect for those just starting out with collaborative development, let's walk through a basic topic: pull requests.

Jonathan Silva user avatar by
Jonathan Silva
·
May. 24, 19 · Open Source Zone · Tutorial
Like (9)
Save
Tweet
12.72K Views

Join the DZone community and get the full member experience.

Join For Free

Whether you’re collaborating on a work assignment with colleagues or contributing to an open-source project, chances are that you will be operating in the following scenario. You make local code changes and then submit those changes to a remote project maintainer for review before those changes are implemented, or merged.

This is called a pull request; you are requesting that someone reviews and approves your changes before they become final.

Watch this video to learn more about what a pull request is, or keep reading.


While pull requests are not a core feature of Git, they are commonplace when it comes to collaborating with Git hosting services. They are especially necessary when working with open-source projects.

Let’s say, for example, that you want to contribute to your favorite open-source project in GitHub. Most open-source projects have a maintainer who can control which changes are approved and merged into the project. They have the control to approve and decline changes as they wish.

Morgan Freeman

How Do I Get Changes Approved With a Pull Request?

After forking the repository on the remote hosting service and cloning it to your local machine, you can start working on making changes to the code.

After you’re happy with the changes, you can push the work up to your fork and open a pull request that will signal the main repo. This pull request asks the maintainer(s) to review your work, provide comments, request edits, etc.

If your pull request is approved, the maintainer will merge your changes into the main repo.

Stephen Colbert Yay

Why Should I Use Pull Request Templates?

Many repos have guidelines for submitting pull requests, requiring the inclusion of a description which should clearly describe what the maintainer can expect when reviewing the code and any standards you, as the developer, have considered before submitting the pull request.

Some projects may even require the use of formalized templates in order to submit proposed changes. A template could include a description checklist, requesting details such as:

  • How a bug was fixed or summary of a new feature.
  • Unit test cases.
  • Whether it was tested on all devices and browsers.
Git Requests Open source

Published at DZone with permission of Jonathan Silva, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • No-Code/Low-Code Use Cases in the Enterprise
  • Exhaustive JUNIT5 Testing with Combinations, Permutations, and Products
  • How to Make Git Forget a Tracked File Now in .gitignore
  • Understand Source Code — Deep Into the Codebase, Locally and in Production

Comments

Open Source Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo