Level 1: Git - Update Git Repository with Sample HTML File

The Nautilus development team has initiated a new project development, establishing various Git repositories to manage each project’s source code. Recently, a repository named /opt/cluster.git was created. The team has provided a sample index.html file located on the jump host under the /tmp directory. This repository has been cloned to /usr/src/kodekloudrepos on the storage server in the Stratos DC.

  1. Copy the sample index.html file from the jump host to the storage server placing it within the cloned repository at /usr/src/kodekloudrepos/cluster.
  2. Add and commit the file to the repository.
  3. Push the changes to the master branch.

@Santosh_KodeKloud Sir, need your help here.
I have copied the file from jump host to storage server using ‘scp’ command. Also moved the file from the tmp dir on storage server to the given location where .git repo is located using ‘sudo mv’ command.

But while using git commands to add, commit and push its not allowing the normal git commands to do it and when i use ‘sudo git’ the task is not completed properly. It says root should not commit but the user natasha’s commit should be present. Its also not allowing using the natasha user as i am committing using the remote server.
What should be the reason for this. Help me sir please.

Following images shows the problem properly


Hi @Manthan_Marathe

Try copying the file to /tmp on the storage server first. Then move the file to the git repo on the storage server.

You might require elevated privileges on ststor01. So, either change to root by sudo -i or use sudo on ststor01.

Thank you sir for replying.
I have done the problem using ‘sudo’ command and successfully completed it.

Further I want to ask about the kodekloud courses as I am a free user currently and I am interested to continue my learning further on kodekloud.
But as the free user access is limited I am not able to do so. Can you please guide me to continue my journey on kodekloud further.