CodeBlanks Logo Icon CodeBlanks

PR flow

Push the branch and set up the PR opening flow.

Pull request workflow from a branch

Changes completed on a feature branch are first pushed to the remote repository. Then, a pull request is opened on GitHub to request merging that branch into the main branch. Team members review the changes and add comments when necessary.

git push -u origin feature/user-login

# Open a pull request on GitHub

Pull request review process

A pull request allows changes to be reviewed before they are added to the main branch. Reviewers can add line comments, request changes, or approve the PR. Necessary corrections can be made by pushing new commits to the same feature branch.

Push feature branch
       ↓
Open pull request
       ↓
Review changes
       ↓
Approve

Practice Push a branch for a PR

Push the feature/report-page branch to the origin remote while establishing an upstream relationship. Then print a message indicating that a pull request will be opened.

Starter code

terminal
# Özellik dalını gönder

# PR mesajını yazdır

Sample solution

terminal
git push -u origin feature/report-page
print("Pull request ready for review")

Expected output

Branch pushed successfully.
Pull request ready for review

Questions and answers

Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.

1 What is the next main step after pushing a feature branch to the remote repository?

  • Open a pull request Correct answer
  • Delete the main branch
  • Reset the entire commit history
  • Delete the local repository

Explanation: After the branch is pushed to the remote repository, a pull request is opened to submit the changes for review.

2 Push the feature branch

Question
git push -u origin ____
Answer
git push -u origin feature/user-login

Explanation: On the first push to the remote repository, the -u option establishes an upstream tracking relationship.

3 Operations in the PR process

Term Meaning
Push Sending a branch to remote
Pull request Opening a merge request
Review Reviewing code changes
Approve Approving changes

All lessons in Intermediate

20 Intermediate final

  1. Branch management
  2. Rebase
  3. Conflict
  4. PR flow