Sarah and Max were working on writting some stories which they have pushed to the repository. Max has recently added some new changes and is trying to push them to the repository but he is facing some issues. Below you can find more details:
SSH into storage server
using user max
and password Max_pass123
. Under /home/max
you will find the story-blog
repository. Try to push the changes to the origin repo and fix the issues. The story-index.txt
must have titles for all 4 stories. Additionally, there is a typo in The Lion and the Mooose
line where Mooose
should be Mouse
.
Click on the Gitea UI
button on the top bar. You should be able to access the Gitea
page. You can login to Gitea
server from UI using username sarah
and password Sarah_pass123
or username max
and password Max_pass123
.
ssh max@ststor01
max $ cd story-blog/
max (master)$ ls
fox-and-grapes.txt frogs-and-ox.txt lion-and-mouse.txt story-index.txt
# Modify story-index.txt to fix the typo
vi story-index.txt - change mooose to mouse
max (master)$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: story-index.txt
no changes added to commit (use "git add" and/or "git commit -a")
max (master)$ git add story-index.txt
max (master)$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: story-index.txt
max (master)$ git commit -m "fixed the typo"
max (master)$ git push
Username for 'http://git.stratos.xfusioncorp.com': max
Password for 'http://max@git.stratos.xfusioncorp.com':
To http://git.stratos.xfusioncorp.com/sarah/story-blog.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'http://git.stratos.xfusioncorp.com/sarah/story-blog.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
max (master)$ git pull --rebase
remote: Enumerating objects: 4, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.
From http://git.stratos.xfusioncorp.com/sarah/story-blog
a92501c..2a22602 master -> origin/master
First, rewinding head to replay your work on top of it...
Applying: Added the fox and grapes story
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Auto-merging story-index.txt
CONFLICT (add/add): Merge conflict in story-index.txt
error: Failed to merge in the changes.
Patch failed at 0001 Added the fox and grapes story
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".
vi story-index.txt
<<<<<<< 2a2260211be52cf3477c862686321131ba0fc5b9
1. The Lion and the Mouse
2. The Frogs and the Ox
3. The Fox and the Grapes
=======
1. The Lion and the Mooose
2. The Frogs and the Ox
3. The Fox and the Grapes
4. The Donkey and the Dog
>>>>>>> Added the fox and grapes story
# fix the file to be as follows:
1. The Lion and the Mouse
2. The Frogs and the Ox
3. The Fox and the Grapes
4. The Donkey and the Dog
git add story-index.txt
git rebase --continue
git push
Username for 'http://git.stratos.xfusioncorp.com': max
Password for 'http://max@git.stratos.xfusioncorp.com':
Counting objects: 4, done.
Delta compression using up to 16 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 886 bytes | 0 bytes/s, done.
Total 4 (delta 0), reused 0 (delta 0)
remote: . Processing 1 references
remote: Processed 1 references in total
To http://git.stratos.xfusioncorp.com/sarah/story-blog.git
2a22602..c97f722 master -> master
Move over to Gitea in browser to complete by signing in as Max 0r Sarah and make sure the story-index.txt file has the correct spelling.
BTW - I my understanding of GIT is pretty poor, lots of googling, AI and a YT video was required for the majority of these GIT based challenges. However they needed to be done in order to get to the K8's section which is what Im really interested in.