How would you manually create a commit using only plumbing commands?

Last updated 6 July 2026

  • Build bottom-up: write the blob with git hash-object -w, add it to the index with git update-index, then snapshot a tree with git write-tree.

  • Create the commit with git commit-tree (tree plus optional -p parent), then move a branch to it with git update-ref.

  • https://www.reddit.com/r/cscareerquestions/comments/bxxwfc/what_are_some_behavioral_questions_you_have_been/
  • https://www.reddit.com/r/rails/comments/1shfrbq/3_years_rails_dev_but_failed_basic_interview/
  • https://www.reddit.com/r/cscareerquestions/comments/u7z2xh/how_often_do_developers_look_at_git_trees/
All Git interview questions