Warning: Some posts on this platform may contain adult material intended for mature audiences only. Viewer discretion is advised. By clicking ‘Continue’, you confirm that you are 18 years or older and consent to viewing explicit content.
# Let Git take a rest with some yummy awk chocolate logs with delicious nuts and seeds, and don't be pushy!
git reset --hard $(git log --reverse | sed -n 1p | awk -F "[ ]"'{print $2}') && git push -f
The machine spirit requires that you submit the correct incantations
like this?
# Let Git take a rest with some yummy awk chocolate logs with delicious nuts and seeds, and don't be pushy! git reset --hard $(git log --reverse | sed -n 1p | awk -F "[ ]" '{print $2}') && git push -f
EDIT: Don’t actually run it.
Can you explain what this does? I’m thinking something along the lines of reverting all commits except the very first one?
You are correct! It sets HEAD to the first commit and then force pushes, deleting everything after HEAD.
Though, it only affects the currently selected branch.
The thingmabob that does the job is bippity-boppity-boo.