From 9abdfebad3d56bb507e6b948b97dbd53fd4831d5 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 5 Dec 2012 12:20:09 -0500 Subject: [PATCH] posts:git:notes: show how to tag a file (e.g. junio-gpg-pub) --- posts/Git/notes.org | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/posts/Git/notes.org b/posts/Git/notes.org index accc19d..85e1993 100644 --- a/posts/Git/notes.org +++ b/posts/Git/notes.org @@ -1410,6 +1410,22 @@ For example, : $ git cat-file blob master:README +** Tag a file (not a commit) + +Add the file (e.g. =my-file= to the object database and get it's +SHA-1: + + : $ git hash-object -w my-file + : fe113d3f96636710600c6b02d5fd421fa7e87dd6 + +Then tag that hash. + + : $ git tag junio-gpg-pub fe113d3f96636710600c6b02d5fd421fa7e87dd6 + +Combining these into one command using Bash's command substitution: + + : $ git tag junio-gpg-pub $(git hash-object -w my-file) + * Troubleshooting ** Git commit hangs with no output -- 2.26.2