2

In Git, one can store objects in Git's storage with git hash-object. That's what I do, to store my public key, which I use to sign Git tags - inspired by this chapter in Git book - http://git-scm.com/book/en/Git-Internals-Git-References#Tags

So, I hash-object my public key, create an annotated tag for it, and push the tag to a remote. And it is pushed all right. However, when other users pull changes from the remote - they don't see this tag (they see, however, other regular tags pointing to revisions).

So, the question is - is it possible to push to a remote an arbitrary object stored with hash-object? Or, otherwise, how the junio-gpg-pub key is actually stored in Git's Git repository?

Tim
  • 12,318
  • 7
  • 50
  • 72
  • Would a git push --all be more effective? Otheriwse, http://stackoverflow.com/questions/11967405/git-how-do-i-push-objects-created-with-git-hash-object-back-to-origin doesn't have yet any answer. – VonC Dec 03 '12 at 12:48
  • @VonC that question doesn't appear to me to be related to this one. – qqx Dec 03 '12 at 15:20
  • @qqx agreed. I must have read it a bit too fast. +1 on your answer. – VonC Dec 03 '12 at 15:32

1 Answers1

3

The other users will need to use git fetch --tags to get the tag with your public key. The fetch command will normally only retrieve tags which point to objects which are reachable from the branches that it is retrieving; this is mentioned in the documentation of the --tags option. Your public key isn't part of the history, therefore it would not be automatically fetched.

qqx
  • 18,947
  • 4
  • 64
  • 68