2 ms·
If the developer is working in their own branch, as is the normal scenario with Git, then they can push that branch to their heart's content - nothing is magica
by int_19h 9y ago
If the developer is working in their own branch, as is the normal scenario with Git, then they can push that branch to their heart's content - nothing is magically changing there. They will, of course, need to merge it with the primary branch eventually - but that's the thing, you merge branches (or rebase them), you don't just replace one with the other... and it's not like the latter is easy to do accidentally. And when you merge, of course, it will only merge the diffs, so the concept of "I haven't modified this file" is inherent. If your fork has only modified the files that no-one else touched, then it doesn't really matter how old it is - it'll still be able to merge; you don't need to be frequently syncing with the main branch.
If the developer is working directly in the main branch, then what you describe can happen - although even then, if someone else makes changes there, there would be a divergence, and push would simply fail, instead of overwriting those changes (unless you explicitly force it by using -f... but the whole point of having that switch is to be a safeguard against destructive operations).
So I'm still confused about the exact scenario here.