Web lists-archives.com

Git allow to unconditionaly remove files on other developer host




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