Skip to content

Instantly share code, notes, and snippets.

@hamjin
Last active June 8, 2026 03:36
Show Gist options
  • Select an option

  • Save hamjin/6d9efa2c7c7c47b05654bc8f4673d647 to your computer and use it in GitHub Desktop.

Select an option

Save hamjin/6d9efa2c7c7c47b05654bc8f4673d647 to your computer and use it in GitHub Desktop.
Git commands
#!/usr/bin/env bash
git reflog expire --expire=now --expire-unreachable=now --rewrite --updateref --stale-fix --all --verbose
git prune -v --expire now
git rebase -i HEAD~1 --exec 'GIT_COMMITTER_DATE="$(date -R)" git commit --amend --date="$(date -R)" --no-edit'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment