Skip to content

Instantly share code, notes, and snippets.

@progrium
Created August 31, 2016 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save progrium/6ec40a63549e25196dcee824e9407f54 to your computer and use it in GitHub Desktop.
Save progrium/6ec40a63549e25196dcee824e9407f54 to your computer and use it in GitHub Desktop.
make an empty branch (destroy) on a bare repo
#!/bin/bash
blob="$(git hash-object -w --stdin < /dev/null)"
git update-index --add --cacheinfo 0644 "$blob" file
tree="$(git write-tree)"
commit="$(echo file | git commit-tree $tree)"
git update-ref refs/heads/destroy $commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment