I have started fiddling with Git using this reference and I created some
fatal: your current branch 'master' does not have any commits yet
Is there a way to make this association using
No, and that's the whole point of
git commit-tree: it's what Git calls a plumbing command, that implements just some small part of the whole system. It does one piece of the whole job, the way a valve or pipe or drain or shower-head does just one piece of the job. You need more pieces to assemble a complete shower.
The plumbing piece that updates references (including branch names, but also other references as well) is
(Note that to have a tree you can attach to a commit, you also need
git write-tree, which in turn needs you to create and populate the index, e.g., using
git update-index. This is all covered in the Git internals page you linked to, but they did leave out the last step with
If you want to create commits and put them on branches in the usual way, you should use the porcelain commands like
git add and
git commit. These are intended to be human-friendly (how well they achieve this particular goal is a matter of opinion :-) ).