Day 32 Git Rebase Task Failed Despite Correct Implementation - Need Help

1. SSH to storage server

ssh natasha@ststor01

2. Navigate to repository

cd /usr/src/kodekloudrepos/cluster

3. Configure git identity

git config --global user.name “Natasha”
git config --global user.email “[email protected]

4. Update master branch

git checkout master
git pull origin master

5. Switch to feature branch and rebase

git checkout feature
git rebase master

6. Push rebased feature branch

git push origin feature --force-with-lease I try in this format but it says

experiencing the same issues, these labs prove to be time wasters when these things happen, and there is no one to help ASAP, or any lab-compliant way to do them. had a similar issue with the git clone task

1 Like

HI @Fola @Fathhy

You don’t need to add another commit.
You need to rebase feature over master and push the feature branch (with’ --force’ if required).

1 Like

but anyhow many of us pass this test no?


I have attempted this Git rebase lab severeally but the task will not pass even though the rebase and push were successful. Below are the steps I followed along with screenshots (attached):

Steps Taken:

  1. SSH to storage server
    ssh natasha@ststor01

  2. Navigate to repository
    cd /usr/src/kodekloudrepos/apps

  3. Configure safe directory & Git identity
    git config --global --add safe.directory /usr/src/kodekloudrepos/apps
    git config --global user.name “Natasha”
    git config --global user.email “[email protected]

  4. Fix ownership/permissions (otherwise fetch failed)
    sudo chown -R natasha:natasha /usr/src/kodekloudrepos
    sudo chmod -R u+rwX /usr/src/kodekloudrepos
    sudo chown -R natasha:natasha /opt/apps.git
    sudo chmod -R u+rwX /opt/apps.git

  5. Verify branches and fetch
    git branch -a
    git fetch origin

  6. Rebase feature over master
    git checkout feature
    git rebase origin/master

  7. Push rebased branch
    git push origin feature --force

  8. Verify history and diff
    git log --oneline --graph --decorate --all -5
    git diff origin/master…origin/feature

Result:
The history looks correct (feature rebased cleanly on master).
feature.txt is the only change compared to master.
Lab still failed.

@Fola @Fathhy This might be of help please check this day 32

1 Like

I got this right now after a lot of stuggling. And that’s what I did:

1st: Acess the repo as root (storage# cd <dir_path)
2nd: Rebase the feature according to the last commits in the master (git rebase master)
3rd: Push guaranteeing that the information in the remote feature branch will stay protected (git push origin feature --force-with-lease)