[git-users] How to save file's first commit, but ignore all further changes to this file?

2016-01-06 Thread Tikhon Tarnavsky
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.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] How to save file's first commit, but ignore all further changes to this file?

2016-01-06 Thread Gergely Polonkai
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"  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.
> 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.


Re: [git-users] How to save file's first commit, but ignore all further changes to this file?

2016-01-06 Thread Tikhon Tarnavsky
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 :

> 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" 
> 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.
>> 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.
> 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.


Re: [git-users] How to save file's first commit, but ignore all further changes to this file?

2016-01-06 Thread Chris Stone
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 >:


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"
>
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
.
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
.
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.


--
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.


Re: [git-users] How to save file's first commit, but ignore all further changes to this file?

2016-01-06 Thread Tikhon Tarnavsky
Thank you.

I tried to add these files to .gitignore, but "git status" shows them as
"modified" or "deleted" anyway.

Using git hook is a good idea too. How can I create a hook which will run
after clone and after each pull (just in case I added some new batches)?

2016-01-06 22:34 GMT+02:00 Chris Stone :

> 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 :
>
>> 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" 
>> 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.
>>> 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.
>> 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.
>
>
> --
> 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.
> 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.


Re: [git-users] How to save file's first commit, but ignore all further changes to this file?

2016-01-06 Thread Philip Oakley
How about (given the comment about it being a template):
create an orphan branch
add just that file to the branch and commit.
Tag the commit 
delete the branch

get folks to 'git checkout tag -- file'. 
Perhaps even make that an alias.

Once it is in the repo it's fixed, unchanged forever!

[or just tweak the alias to checkout the file direct from the sha1 where you 
committed the master version!]

just a thought (all untested..)

--
Philip
  - Original Message - 
  From: Tikhon Tarnavsky 
  To: Git for human beings 
  Sent: Wednesday, January 06, 2016 6:05 PM
  Subject: [git-users] How to save file's first commit, but ignore all further 
changes to this file?


  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.
  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.