Created
February 13, 2012 09:15
-
-
Save bleis-tift/1815369 to your computer and use it in GitHub Desktop.
空コミットを最初のコミットとして作るコマンド(git initの代わり)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ただまぁ--amend使わずに、ブランチを消してしまって--allow-emptyでもいい気はします