From: W. Trevor King Date: Wed, 5 Dec 2012 17:20:09 +0000 (-0500) Subject: posts:git:notes: show how to tag a file (e.g. junio-gpg-pub) X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9abdfebad3d56bb507e6b948b97dbd53fd4831d5;p=mw2txt.git posts:git:notes: show how to tag a file (e.g. junio-gpg-pub) --- 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