Skip to content

Instantly share code, notes, and snippets.

@listenrightmeow
Created July 19, 2023 23:17
Show Gist options
  • Save listenrightmeow/7d641465e65b6e9c47346233740c3762 to your computer and use it in GitHub Desktop.
Save listenrightmeow/7d641465e65b6e9c47346233740c3762 to your computer and use it in GitHub Desktop.
Push history-less/empty branch to origin
[alias]
empty = "!sh -c 'git switch --orphan $0 && git commit --allow-empty -m \"empty commit\" && git rebase --onto master $0 && git push -u origin $0'"
git empty branch/name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment