0
0
Gitdevops~15 mins

Handling PR feedback and updates in Git - Mini Project: Build & Apply

Choose your learning style9 modes available
Handling PR Feedback and Updates
📖 Scenario: You are working on a team project using Git and GitHub. Your teammate has reviewed your Pull Request (PR) and left feedback asking for some changes. You need to update your PR with the requested fixes so the team can merge your work smoothly.
🎯 Goal: Learn how to fetch PR feedback, make changes in your local branch, commit those changes, and push updates to the same PR branch on GitHub.
📋 What You'll Learn
Create a new branch called feature-update from main
Make a simple change to a file called app.txt by adding the line Update after PR feedback
Commit the change with the message fix: update after PR feedback
Push the updated branch feature-update to the remote repository
💡 Why This Matters
🌍 Real World
In real projects, teammates review your code and ask for changes. You update your PR branch with fixes so the team can merge your work smoothly.
💼 Career
Knowing how to handle PR feedback and update branches is essential for collaboration in software development teams using Git and GitHub.
Progress0 / 4 steps
1
Create a new branch for your PR updates
Use the command git checkout -b feature-update to create and switch to a new branch called feature-update from main.
Git
Need a hint?

Think of this as creating a new workspace to make your changes without disturbing the main code.

2
Make the requested change in app.txt
Add the line Update after PR feedback at the end of the file app.txt using a command like echo or by editing the file.
Git
Need a hint?

Use echo "text" >> filename to add a line to the end of a file.

3
Commit your changes with a clear message
Use git add app.txt to stage the file, then commit with git commit -m "fix: update after PR feedback" to save your changes locally.
Git
Need a hint?

Remember to stage your changes before committing.

4
Push your updated branch to the remote repository
Use git push origin feature-update to send your updated branch to GitHub, updating the existing PR with your fixes.
Git
Need a hint?

This command updates your remote branch so the PR reflects your new changes.