On Tue, Jan 22, 2013 at 10:14:12PM -0800, Rahul Gupta wrote:

> This is probably a hangover from SVN habits but still I would like the Git 
> way doing this.
> Normally using SVN, when I work on a latex file, I store the pdf generated 
> in my Tag folder along with latex file. There is no concept of Tag folder 
> in Git and while I want to store the PDF generated at each release-tag, I 
> do not want them in my project folders or to be tracked at all. What is the 
> best way of achieving this?

Git is able to keep in its database any object at all provided there is
a reference to it so that it's not garbage-collected.  A reference is,
typically, a branch or a tag.

To do that, use something like

$ git tag your-file.pdf $(git hash-object -w your-file.pdf)

The `git hash-object` program calculates the SHA-1 hash over your file,
writes the file to the database ("-w") and prints that SHA-1 name to
stdout.  The `git tag` program accepts a tag name and the SHA-1 name of
an object the tag should reference and creates the tag.

After that, you are able to get the file "out of" your tag by doing

$ git show your-file.pdf >your-file.pdf
$ git cat-file blob your-file.pdf >your-file.pdf


Reply via email to