29/100 Manage Git Pull Requests
Max
want to push some new changes to one of the repositories but we don't want people to push directly to master
branch, since that would be the final version of the code. It should always only have content that has been reviewed and approved. We cannot just allow everyone to directly push to the master branch. So, let's do it the right way as discussed below:
SSH into storage server
using user max
, password Max_pass123
. There you can find an already cloned repo under Max
user's home. Max has written his story about The 🦊 Fox and Grapes 🍇Max has already pushed his story to remote git repository hosted on Gitea
branch story/fox-and-grapes
Check the contents of the cloned repository. Confirm that you can see Sarah's story and history of commits by running git log
and validate author info, commit message etc. Max has pushed his story, but his story is still not in the master
branch. Let's create a Pull Request(PR) to merge Max's story/fox-and-grapes
branch into the master
branch
Click on the Gitea UI
button on the top bar. You should be able to access the Gitea
page.
UI login info:
- Username: max
- Password: Max_pass123
PR title : Added fox-and-grapes story
PR pull from branch: story/fox-and-grapes
(source)
PR merge into branch: master
(destination)
Before we can add our story to the master
branch, it has to be reviewed. So, let's ask tom
to review our PR by assigning him as a reviewer
Add tom as reviewer through the Git Portal UI
- Go to the newly created PR
- Click on Reviewers on the right
- Add tom as a reviewer to the PR
Now let's review and approve the PR as user Tom
Login to the portal with the user tom
Logout of Git Portal UI
if logged in as max
UI login info:
- Username: tom
- Password: Tom_pass123
PR title : Added fox-and-grapes story
Review and merge it.
Note:
For these kind of scenarios requiring changes to be done in a web UI, please take screenshots so that you can share it with us for review in case your task is marked incomplete. You may also consider using a screen recording software such as loom.com to record and share your work.
ssh max@ststor01
Welcome to xFusionCorp Storage server.
max $ ls
story-blog
max $ cd story-blog/
max (story/fox-and-grapes)$ ls
fox-and-grapes.txt frogs-and-ox.txt lion-and-mouse.txt
max $ git log
commit dd284b971c97728705a0bb94bc9ab5f177fa1eb9
Author: max <max@stratos.xfusioncorp.com>
Date: Thu Oct 2 09:08:57 2025 +0000
Added fox-and-grapes story
commit c7973308758a926ee4be5764eccce1e6b6b51210
Merge: 7a06cf9 285fdde
Author: sarah <sarah@stratos.xfusioncorp.com>
Date: Thu Oct 2 09:08:56 2025 +0000
Merge branch 'story/frogs-and-ox'
commit 7a06cf99910417616f87f9952049c908a7f7e766
Author: sarah <sarah@stratos.xfusioncorp.com>
Date: Thu Oct 2 09:08:56 2025 +0000
Fix typo in story title
commit 285fdded7b70cb6470a9b3692ab3ff1e7751af09
Author: sarah <sarah@stratos.xfusioncorp.com>
Date: Thu Oct 2 09:08:56 2025 +0000
Completed frogs-and-ox story
commit 4bcdb13f60cd8477693dca3a2246690bdead2818
Author: sarah <sarah@stratos.xfusioncorp.com>
Date: Thu Oct 2 09:08:56 2025 +0000
Added the lion and mouse story
commit 15468fdcd95b7da1a703ebb04cdd1641e59519a2
Author: sarah <sarah@stratos.xfusioncorp.com>
Date: Thu Oct 2 09:08:56 2025 +0000
Add incomplete frogs-and-ox story
# List all available branchs
git branch
master
* story/fox-and-grapes
# Checkout the master branch, currently the * denotes we are in the story/fox-and grapes branch
max (story/fox-and-grapes)$ git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
# As per instructions - we see that fox and grapes is not in master
max (master)$ ls
frogs-and-ox.txt lion-and-mouse.txt
Complete the remaining steps in the Gitea UI as per the instructions.