Need task review | Important

Hello,

I have completed the given task correctly, but system keep failing me, tried 4-5 times but still facing same issue. Please check if I’m missing something

Task: The Nautilus application development team has been working on a project repository /opt/cluster.git . This repo is cloned at /usr/src/kodekloudrepos on storage server in Stratos DC . They recently shared the following requirements with DevOps team: Create a new branch xfusion in /usr/src/kodekloudrepos/cluster repo from master and copy the /tmp/index.html file (present on storage server itself) into the repo. Further, add/commit this file in the new branch and merge back that branch into master branch. Finally, push the changes to the origin for both of the branches.

My Action: thor@jumphost ~$ ssh natasha@ststor01
The authenticity of host ‘ststor01 (172.16.238.15)’ can’t be established.
ED25519 key fingerprint is SHA256:pxC4yGAOD3I2XEIvkdGtOwmb4gaqGnmJO9WnKiPjz50.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added ‘ststor01’ (ED25519) to the list of known hosts.
natasha@ststor01’s password:
[natasha@ststor01 ~]$ sudo chown -R natasha:natasha /usr/src/kodekloudrepos/cluster /opt/cluster.git

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

[sudo] password for natasha:
[natasha@ststor01 ~]$ cd /usr/src/kodekloudrepos/cluster
[natasha@ststor01 cluster]$ git status
On branch master
Your branch is up to date with ‘origin/master’.

nothing to commit, working tree clean
[natasha@ststor01 cluster]$ git branch

  • master
    [natasha@ststor01 cluster]$ git checkout master
    Already on ‘master’
    Your branch is up to date with ‘origin/master’.
    [natasha@ststor01 cluster]$ git config user.name “natasha”
    git config user.email “[email protected]
    [natasha@ststor01 cluster]$ git checkout masterAlready on ‘master’
    Your branch is up to date with ‘origin/master’.
    [natasha@ststor01 cluster]$ git checkout -b xfusion
    Switched to a new branch ‘xfusion’
    [natasha@ststor01 cluster]$ git branch
    master
  • xfusion
    [natasha@ststor01 cluster]$ cp /tmp/index.html .
    [natasha@ststor01 cluster]$ ls -la index.html
    -rw-r–r-- 1 natasha natasha 27 Sep 19 09:22 index.html
    [natasha@ststor01 cluster]$ git add index.html
    [natasha@ststor01 cluster]$ git commit -m “Add index.html file in xfusion branch”

[xfusion bf38c30] Add index.html file in xfusion branch
1 file changed, 1 insertion(+)
create mode 100644 index.html
[natasha@ststor01 cluster]$ git push origin xfusion
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 16 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 360 bytes | 360.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
To /opt/cluster.git

  • [new branch] xfusion → xfusion
    [natasha@ststor01 cluster]$ git checkout master
    Switched to branch ‘master’
    Your branch is up to date with ‘origin/master’.
    [natasha@ststor01 cluster]$ git merge xfusion
    Updating 579e323…bf38c30
    Fast-forward
    index.html | 1 +
    1 file changed, 1 insertion(+)
    create mode 100644 index.html
    [natasha@ststor01 cluster]$ git push origin master
    Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
    To /opt/cluster.git
    579e323…bf38c30 master → master
    [natasha@ststor01 cluster]$ git ls-remote --heads origin
    bf38c30da1e36703fcfee169bff68a1ce0a157e1 refs/heads/master
    bf38c30da1e36703fcfee169bff68a1ce0a157e1 refs/heads/xfusion
    [natasha@ststor01 cluster]$ git branch -a
    echo “Task completed successfully!”
  • master
    xfusion
    remotes/origin/master
    remotes/origin/xfusion
    Task completed successfully!
    [natasha@ststor01 cluster]$ git status
    On branch master
    Your branch is up to date with ‘origin/master’.

nothing to commit, working tree clean
[natasha@ststor01 cluster]$ git remote -v
origin /opt/cluster.git (fetch)
origin /opt/cluster.git (push)
[natasha@ststor01 cluster]$ git branch -a

  • master
    xfusion
    remotes/origin/master
    remotes/origin/xfusion
    [natasha@ststor01 cluster]$ git log --oneline --graph --all
  • bf38c30 (HEAD → master, origin/xfusion, origin/master, xfusion) Add index.html file in xfusion branch
  • 579e323 initial commit
    [natasha@ststor01 cluster]$ cat index.html
    Welcome to Nautilus Group ![natasha@ststor01 cluster]$

Hi @Pramodpalnati

Please share the course name, level, and task name, and I’ll check it.

Hello @raymond.baoly ,

Thanks for the response.

Here are the details:

Course: 100 days of DevOps
Level: NA
Task Name: Day 25: Git Merge Branches

Please let me know if any other details needed.

Regards,
Pramod

Please check the answer here: Task Review Request | Day 25: Git Merge Branches | 100 days of DevOps - #2 by raymond.baoly
Please avoid creating multiple posts for the same issue. You can delete this post.

Hi @Pramodpalnati

As all the files are owned by root. You need to become root on the Storage Server. No need to change the ownership of files.

cd into /usr/src/kodekloudrepos/<repo-dir>, create the new branch. Then copy the /tmp/<file> to cwd.
Add, commit, and push to the newly created branch.

Switch to master merge the branch into master, push.
Finally, if this helps, delete your duplicate post on the same forum :slight_smile:

1 Like

Thank you @Santosh_KodeKloud, this helped!