In the git internals chapter of git-scm
book there is an example of how git tree can be created:
Git normally creates a tree by taking the state of your staging area or index and writing a series of tree objects from it. So, to create a tree object, you first have to set up an index by staging some files.
And then they list commands that I can use to create the tree. My question is whether I can create a tree without using index (staging area)? For example instead of doing this:
git update-index --add --cacheinfo 100644 83baae618... test.txt
Use something like this:
git create tree --add --cacheinfo 100644 83baae618... test.txt
Update based on Ismail Badawi's anser:
$ echo 'making tree' | git hash-object -w --stdin
07dae42a0730df1cd19b0ac693c6894a02ed6ad0
and then
$ echo -e '100644 blob 07dae42a0730df1cd19b0ac693c6894a02ed6ad0 \maketree.txt' | git mktree
fatal: input format error: 100644 blob 07dae42a0730df1cd19b0ac693c6894a02ed6ad0 \maketree.txt