A pull request (PR) asks to merge a branch into another, usually main. It is where teams review code.
Create a branch and commit your work.
Push the branch: git push -u origin feature-search
On GitHub, click Compare & pull request, describe the change and request reviewers.
Address review comments by pushing more commits.
When approved and checks pass, merge the PR and delete the branch.
The GitHub CLI can do it from the terminal: gh pr create.
💡 Key Takeaways: Git Pull Requests
Mastering Git Pull Requests helps you write clean and reliable Git code. Follow standard conventions, test edge cases, and keep logic simple. Try running the code example below and complete the exercises to build confidence.
Git Pull Requests Code Example
Git
git switch -c feature-search
# ...edit files...
git commit -am "Add search bar"
git push -u origin feature-search
gh pr create --title "Add search bar" --body "Adds a search bar to the header."
Output
https://github.com/alikhan/my-project/pull/1
Run this example on your own computer. The "Get Started" lesson shows how to set it up.