I was working on the Git cherry-pick tasks (e.g., /opt/media.git cloned in /usr/src/kodekloudrepos/media)

I was working on the Git cherry-pick tasks (e.g., /opt/media.git cloned in /usr/src/kodekloudrepos/media).

  • The main steps I followed:
    1. Fixed repo ownership (chown) and added safe.directory to bypass “dubious ownership” errors.
    2. Configured user.name and user.email for Git commits.
    3. Checked the feature branch logs, found the commit with message “Update info.txt”.
    4. Switched to master and ran git cherry-pick <commit-hash>.
    5. Fixed ownership of the bare repo in /opt/... to allow git push origin master.
    6. Copied info.txt to /tmp/media/info.txt and set proper permissions.
    7. Verified with:
grep -qs -- 'Welcome to xFusionCorp Industries!' /tmp/media/info.txt

→ Output: OK :white_check_mark:

Even though I completed all steps and validated manually, the platform sometimes returned:

Unexpected exit code 2 ... grep -qs -- 'Welcome to xFusionCorp Industries!' /tmp/media/info.txt

So the task shows as failed, but the manual check confirms everything is correct.


Hi @jobamatura

The files are owned by root, so we become root here. No need to work on file ownership.