Navigate to /usr/src/kodekloudrepos/demo git repository on the Storage server.
/usr/src/kodekloudrepos/demo
Reset the repository so that only two commits remain:
initial commit
add data.txt file
Make sure the working directory and HEAD are aligned to add data.txt file.
Push the updated state to the remote, replacing existing history.
SSH to storage server and switch to root if needed
ssh natasha@ststor01 sudo su -
cd /usr/src/kodekloudrepos/demo
Find the commit hash for "add data.txt file"
git log --oneline
Reset to "add data.txt file"
git rebase -i --root
Keep only:
(Delete or drop other commits in the interactive editor)
Force push cleaned-up history
git push origin master --force
Verify only two commits remain
Last updated 7 months ago