0

When I use Egit to push something to a team in Bitbucket (we are all admins), the previous post from any member is deleted. The same thing happens with the other members if they push something too.

I use this configurations:

enter image description here

Everything works well but this, there's any idea to solve this?

Sergio Carneiro
  • 3,726
  • 4
  • 35
  • 51

1 Answers1

1

Why do you have "Force Update" checked?

Normally (when "Force Update" is not configured), in a situation where you would discard other people's changes, the server rejects the push with a "Non fast-forward" message. In that case you have to first merge the remote changes into your local branch, and then push again. With this, the other changes are preserved.

But when you have "Force Update" checked and push a branch, what happens is that the branch on the remote repository is updated to point to the same commit that it pointed to on your local branch. That happens even when your branch is behind or has diverged from the remote branch, causing it to effectively overwrite/discard the other people's commits.

So what you want is to disable "Force Update" for refs/heads/* (head is another word for branch). See also Note about fast-forwards in the help for git push.

As a note: In some server software it's possible to configure the repository so that such "non fast-forward pushes" are denied (regardless of the force flag of the client). But that doesn't seem to be supported by Bitbucket yet, see this issue.

robinst
  • 30,027
  • 10
  • 102
  • 108