Resolve Git Merge Conflicts-ValidationError

Hi Team, @rahul456 @Inderpreet
I got below task.

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 + button in the top left corner and select option Select port to view on Host 1, enter port 8000 and click on Display Port. 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.

Final file in git.

As per error no task regarding to remove === from file. May be file description need to update correctly.

image

ssh max@ststor01

Sarah_pass123 


Task Status - Failed
- story-index.txt contains '='. Remove the line that contains '===='

max (master)$ cat story-index.txt
<<<<<<< HEAD
1. The Lion and the Mooose
2. The Frogs and the Ox
3. The Fox and the Grapes
4. The Donkey and the Dog
=======
1. The Lion and the Mouse
2. The Frogs and the Ox
3. The Fox and the Grapes



thor@jump_host /$ ssh max@ststor01
max@ststor01's password:
Welcome to xFusionCorp Storage server.
max $ cd
max $ pwd
/home/max
max $ cd story-blog/
max (master)$ ll-bash: ll: command not found
max (master)$ ls
fox-and-grapes.txt  frogs-and-ox.txt    lion-and-mouse.txt  story-index.txt
max (master)$ vi line-and-mouse.txt
max (master)$ git pull
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
   d488666..bbff0ae  master     -> origin/master
Auto-merging story-index.txt
CONFLICT (add/add): Merge conflict in story-index.txt
Automatic merge failed; fix conflicts and then commit the result.
max (master)$ cat story-index.txt
<<<<<<< HEAD
1. The Lion and the Mooose
2. The Frogs and the Ox
3. The Fox and the Grapes
4. The Donkey and the Dog
=======
1. The Lion and the Mouse
2. The Frogs and the Ox
3. The Fox and the Grapes
>>>>>>> bbff0ae097d48d01041d2887a9d96f8a124203e8
max (master)$ vi story-index.txt
max (master)$ git status
On branch master
Your branch and 'origin/master' have diverged,
and have 1 and 1 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)
You have unmerged paths.
  (fix conflicts and run "git commit")

Unmerged paths:
  (use "git add <file>..." to mark resolution)

        both added:      story-index.txt

no changes added to commit (use "git add" and/or "git commit -a")
max (master)$ git add .
max (master)$ git status
On branch master
Your branch and 'origin/master' have diverged,
and have 1 and 1 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)
All conflicts fixed but you are still merging.
  (use "git commit" to conclude merge)

Changes to be committed:

        modified:   story-index.txt

max (master)$ git commit -m "Fixed typo in story-index.txt file"
[master 2edf163] Fixed typo in story-index.txt file
 Committer: Linux User <[email protected]>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly. Run the
following command and follow the instructions in your editor to edit
your configuration file:

    git config --global --edit

After doing this, you may fix the identity used for this commit with:

    git commit --amend --reset-author

max (master)$ git push origin master
Username for 'http://git.stratos.xfusioncorp.com': max
Password for 'http://[email protected]':
Counting objects: 7, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 1.24 KiB | 0 bytes/s, done.
Total 7 (delta 1), reused 0 (delta 0)
remote: . Processing 1 references
remote: Processed 1 references in total
To http://git.stratos.xfusioncorp.com/sarah/story-blog.git
   bbff0ae..2edf163  master -> master

I have tried for review and removed == from file then its succeeded.

May be need to update Description for statements.

@rahul456