Skip to content

Instantly share code, notes, and snippets.

@bleis-tift
Created February 13, 2012 09:15
Show Gist options
  • Save bleis-tift/1815369 to your computer and use it in GitHub Desktop.
Save bleis-tift/1815369 to your computer and use it in GitHub Desktop.
空コミットを最初のコミットとして作るコマンド(git initの代わり)
#!/bin/sh
msg=${1:-"first commit"}
git init
tree_hash=$(git write-tree)
commit_hash=$(echo -n "$msg" | git commit-tree $tree_hash)
echo $commit_hash > .git/refs/heads/master
@bleis-tift
Copy link
Author

ただまぁ--amend使わずに、ブランチを消してしまって--allow-emptyでもいい気はします

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment