Page MenuHomePhabricator

Remote branches of git mirror are deleted
Closed, ResolvedPublic

Description

Phabricator deletes all branches in a mirror repository that are not in the Phabricator repository.

Reproduction steps:

  • Create a new repository "hosted on phabricator"
  • add an external (e.g. github) repository as mirror
  • Create a branch foo and push it to the external repository
  • Wait until phabricator updates the repository (or force it)

Expected results:
Phabricator should only mirror branches that are added in phabricator. So it should keep the foo branch as is.

Current result:
The foo branch in the external repository will get removed by phabracitor as it does not exist there.

I think there should be a configuration option to change this behavior.
A workaround is to configure phabricator to only the master branch. That keeps the external branches intact. That info was wrong. Branch is still removed on the mirror.

Based on the decisions in this ticket the documentation may should be extended (https://secure.phabricator.com/book/phabricator/article/diffusion_uris/#mirror-a-repository)

Event Timeline

This is expected, and consistent with git's own definition of "mirror". The exact command we use is:

$ git push --verbose --mirror -- <uri>

Where did your expectation arise from?

I already thought that while writing the ticket ;-) That's the reason i added the last sentence to adjust the documentation. Maybe it would be good to know that this feature is using the git mirror function and may overwrite data of the mirror.

Thanks! Maybe this can save some time for some people...