I think you could check in the "header files" as you want them to be then add the files to your .gitignore that way any changes made to those header files would not be committed to the repo. Another option I think would work which might be the better solution is to use a git hook to copy the empty header files to the working directory after checkout.

On 1/6/2016 12:39 PM, Tikhon Tarnavsky wrote:
I have some "data batches" inside my project. These batches are in a binary proprietary format, and I don't need to save their content into the repo. User can add a files to a batch using an external binary utility. But every batch should have some "batch header" files (binary also, but very small for the empty batch - a couple of bytes). I put the "header files" into my repo, so any user will have a correct "empty batch" after clone. But then she needs to work with this batch - add some files, etc. Files inside a batch is in my .gitignore, but now a user needs to empty a batch before every commit, or to select files manually, excluding the "batch header" files. If she will forget to exclude header files, the next user can get a broken batch, with "non-empty" header, but without any files. A files inside a batch shouldn't be in the repo not only because of the big size - it can contain some confidential information. I want any user to get the empty batch header files for every new batch I add, but not to push any new versions of these files.


2016-01-06 21:13 GMT+02:00 Gergely Polonkai <gerg...@polonkai.eu <mailto:gerg...@polonkai.eu>>:

    There is an assume-unchanged option you can set with
    git-update-index, but that's for your local repository only; it is
    possible that other developers will overwrite the file.

    If you tell us some more details, the list may give you better
    answers or alternatives, though.

    Best,
    Gergely

    On 6 Jan 2016 19:05, "Tikhon Tarnavsky"
    <tikhon.tarnav...@gmail.com <mailto:tikhon.tarnav...@gmail.com>>
    wrote:

        Hi all,

        I need to save some file in my git repo in it's current state,
        ignoring all changes to it forever. Any suggestions?
-- You received this message because you are subscribed to the
        Google Groups "Git for human beings" group.
        To unsubscribe from this group and stop receiving emails from
        it, send an email to git-users+unsubscr...@googlegroups.com
        <mailto:git-users+unsubscr...@googlegroups.com>.
        For more options, visit https://groups.google.com/d/optout.

-- You received this message because you are subscribed to a topic in
    the Google Groups "Git for human beings" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/git-users/gq5rg-AA95c/unsubscribe.
    To unsubscribe from this group and all its topics, send an email
    to git-users+unsubscr...@googlegroups.com
    <mailto:git-users+unsubscr...@googlegroups.com>.
    For more options, visit https://groups.google.com/d/optout.




--
З повагою, Тихон Тарнавський.
--
You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com <mailto:git-users+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Git for 
human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to