555603822c01ca317821feaa26e9608f3aad983c
[git-central.git] / scripts / create-gitconfig
1 #!/bin/sh
2
3 # Create an empty file object
4 empty_file_hash=$(git hash-object -w --stdin <<FOO
5 FOO)
6
7 # Make a root directory tree with the config file in it
8 config_tree_hash=$(git mktree <<FOO
9 100644 blob $empty_file_hash    config
10 FOO)
11
12 # Commit the root directory tree
13 commit_hash=$(git commit-tree $config_tree_hash <<FOO
14 Initial commit on config branch.
15 FOO)
16
17 # Push the commit out to the gitconfig branch
18 git update-ref refs/heads/gitconfig "$commit_hash" 0000000000000000000000000000000000000000
19