Skip to content
This repository has been archived by the owner on Jan 22, 2024. It is now read-only.

Latest commit

 

History

History
executable file
·
26 lines (19 loc) · 555 Bytes

5-make-branch.md

File metadata and controls

executable file
·
26 lines (19 loc) · 555 Bytes

Attach the Commit to a Branch

Git isn't truly happy until our commit is attached to a branch:

git update-ref refs/heads/master <commit-SHA>

Let's inspect it:

cat .git/refs/heads/master

A branch with a single commit is no fun. Let's do it again:

echo "some content" > another.md
git hash-object -w another.md
git update-index --add another.md
git write-tree
echo "a second commit" | git commit-tree <tree-SHA> -p <parent-commit-SHA>
git update-ref refs/heads/master <commit-SHA>