Community
Participate
Working Groups
Documentation describing setRemoveDeletedRefs tells us that git push --prune behaviour is supported and one can enable it by setting removeDeletedRefs to true. //from org.eclipse.jgit.transport /** * Set whether or not to remove refs which no longer exist in the source. * <p> * If true, refs at the destination repository (local for fetch, remote for * push) are deleted if they no longer exist on the source side (remote for * fetch, local for push). * <p> * False by default, as this may cause data to become unreachable, and * eventually be deleted on the next GC. * * @param remove true to remove refs that no longer exist. */ public void setRemoveDeletedRefs(final boolean remove) { removeDeletedRefs = remove; } That doesn't happen for push: neither locally removed heads or refs becomes deleted on remote unless implicit refspec ":refs/heads/head-to-delete" passed. Works as expected for fetch.