git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Git allow to unconditionaly remove files on other developer host
@ 2017-04-15 11:36 KES
  2017-04-15 12:27 ` Johannes Sixt
  0 siblings, 1 reply; 4+ messages in thread
From: KES @ 2017-04-15 11:36 UTC (permalink / raw)
  To: git

Hi.

That curious, but git allow to unconditionally delete files on other developer host when he do `git pull`

How to reproduce:

1. File should be ignored:
echo "somefile" >> .gitignore

2. Add this ignored file into repository
git add -f somefile

3. Push changes to origin
git push

4. When other developer has also 'somefile' on his host and when he does
git pull

Content of hist local `somefile` file will be replaced by content pushed by first developer

EXPECTED: git should warn about that content will be replaced and do not pull/checkout until we force pull/checkout

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Git allow to unconditionaly remove files on other developer host
  2017-04-15 11:36 Git allow to unconditionaly remove files on other developer host KES
@ 2017-04-15 12:27 ` Johannes Sixt
  2017-04-15 12:53   ` Konstantin Khomoutov
  2018-01-06 12:06   ` KES
  0 siblings, 2 replies; 4+ messages in thread
From: Johannes Sixt @ 2017-04-15 12:27 UTC (permalink / raw)
  To: KES, git

Am 15.04.2017 um 13:36 schrieb KES:
> That curious, but git allow to unconditionally delete files on other developer host when he do `git pull`
>
> How to reproduce:
>
> 1. File should be ignored:
> echo "somefile" >> .gitignore
>
> 2. Add this ignored file into repository
> git add -f somefile
>
> 3. Push changes to origin
> git push
>
> 4. When other developer has also 'somefile' on his host and when he does
> git pull
>
> Content of hist local `somefile` file will be replaced by content pushed by first developer

This happens *only* if the other developers also have somefile mentioned 
in their .gitignore.

>
> EXPECTED: git should warn about that content will be replaced and do not pull/checkout until we force pull/checkout

If somefile is *not* mentioned in their .gitignore, the file is not 
removed and there is a warning.

Know that Git regards everything mentioned in .gitignore as dispensible; 
IOW, by mentioning a file in .gitignore you actually give permission to 
remove the file if necessary. Git does not have a feature to say "ignore 
this file, but it is precious".

-- Hannes


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Git allow to unconditionaly remove files on other developer host
  2017-04-15 12:27 ` Johannes Sixt
@ 2017-04-15 12:53   ` Konstantin Khomoutov
  2018-01-06 12:06   ` KES
  1 sibling, 0 replies; 4+ messages in thread
From: Konstantin Khomoutov @ 2017-04-15 12:53 UTC (permalink / raw)
  To: git; +Cc: Johannes Sixt, KES

On Sat, 15 Apr 2017 14:27:00 +0200
Johannes Sixt <j6t@kdbg.org> wrote:

> > That curious, but git allow to unconditionally delete files on
> > other developer host when he do `git pull`
[...]
> Know that Git regards everything mentioned in .gitignore as
> dispensible; IOW, by mentioning a file in .gitignore you actually
> give permission to remove the file if necessary. Git does not have a
> feature to say "ignore this file, but it is precious".

KES, you might also be interested in this recent thread [1].

1. http://public-inbox.org/git/CAPUVn2u0Uos2mT5+4ejj8m0okNK6XwerL6ce2miHfhtuEs-ZnQ@mail.gmail.com/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Git allow to unconditionaly remove files on other developer host
  2017-04-15 12:27 ` Johannes Sixt
  2017-04-15 12:53   ` Konstantin Khomoutov
@ 2018-01-06 12:06   ` KES
  1 sibling, 0 replies; 4+ messages in thread
From: KES @ 2018-01-06 12:06 UTC (permalink / raw)
  To: Johannes Sixt, git


> This happens *only* if the other developers also have somefile mentioned
> in their .gitignore.

It will be mentioned, because of I can add/push, wait developers pull,  add/push

I can do this because I was angry or was fired. So this is my last "surprise" for others ))

>>  EXPECTED: git should warn about that content will be replaced and do not pull/checkout until we force pull/checkout
>
> If somefile is *not* mentioned in their .gitignore, the file is not
> removed and there is a warning.

As you can see the file is not just ignored in my case it is important because added to the repo


we can think of some sort of default configuration stored in repo. 
But added to ignore file because developers do not want to track local changes
(every developer has own options when configure local instance of application)

it *this very important* to not lose these options while switching between branches or pull from remote.

And I do not expect and do not want to get such "surprises" from anyone

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-01-06 12:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-15 11:36 Git allow to unconditionaly remove files on other developer host KES
2017-04-15 12:27 ` Johannes Sixt
2017-04-15 12:53   ` Konstantin Khomoutov
2018-01-06 12:06   ` KES

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).