Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Added git-baseless-commit.

  • Loading branch information...
commit a16421d649cde9f063c5c3959ef945e10b90b022 1 parent 1f3d4ab
@dustin authored
Showing with 35 additions and 0 deletions.
  1. +35 −0 git-baseless-commit
35 git-baseless-commit
@@ -0,0 +1,35 @@
+# WHY!?
+# The purpose of this command is to allow me to create a snapshot of a
+# tree without history. My primary use for such a thing is to
+# distribute large generated documentation sets as gh-pages for
+# github.
+if [ -z "$msg" ]
+ echo "Usage: git baseless-commit my awesome commit message"
+ exit 1
+thisbranch=`git symbolic-ref HEAD`
+oldhead=`git rev-parse HEAD`
+if [ $thisbranch != refs/heads/gh-pages ]
+ echo "You're currently on a branch called $thisbranch"
+ echo "If you're OK destroying that branch, hit enter, otherwise hit ^C"
+ read all_about_it
+tree=`git write-tree`
+commit=`echo "$msg" | git commit-tree $tree`
+git symbolic-ref -m "git baseless-commit" HEAD $thisbranch
+git reset --hard $commit
+echo "If you messed up and destroyed something on accident, you can"
+echo "still get your old head back: $oldhead"

0 comments on commit a16421d

Please sign in to comment.
Something went wrong with that request. Please try again.