DON'T use forced push for GitHub replication.
Typically people using GitHub keep on pushing to it
directly, even when configured as Gerrit slave.
Unfortunately the Gerrit default setting is "force push"
(+refs/*:refs/*) which causes unpleasant surprises.
Use normal push (refs/*:refs/*) for replication and leave
the responsibility to the user to rebase the Gerrit
repository when needed.
Change-Id: Ib7c4ed69c777d2bf5ffd98921821971d5f9c658e
diff --git a/github-plugin/src/main/java/com/googlesrouce/gerrit/plugins/github/git/ReplicationConfig.java b/github-plugin/src/main/java/com/googlesrouce/gerrit/plugins/github/git/ReplicationConfig.java
index 2f3dcaa..79c9324 100644
--- a/github-plugin/src/main/java/com/googlesrouce/gerrit/plugins/github/git/ReplicationConfig.java
+++ b/github-plugin/src/main/java/com/googlesrouce/gerrit/plugins/github/git/ReplicationConfig.java
@@ -59,6 +59,7 @@
"remote", organisation, "projects")));
projects.add(projectName);
replicationConf.setStringList("remote", organisation, "projects", projects);
+ replicationConf.setString("remote", organisation, "push", "refs/*:refs/*");
replicationConf.save();
}