diff --git a/src/main/java/io/jenkins/plugins/git_push/GitPushCommand.java b/src/main/java/io/jenkins/plugins/git_push/GitPushCommand.java index 685d6a9..a5a7d93 100644 --- a/src/main/java/io/jenkins/plugins/git_push/GitPushCommand.java +++ b/src/main/java/io/jenkins/plugins/git_push/GitPushCommand.java @@ -47,6 +47,7 @@ public void call(String targetBranch, String targetRepo) git.fetch_().from(remoteURI, remote.getFetchRefSpecs()).execute(); ObjectId remoteRev = git.revParse(targetRepo + "/" + targetBranch); git.merge().setRevisionToMerge(remoteRev).execute(); + git.push().to(remoteURI).ref("HEAD:" + targetBranch).execute(); git.push().to(remoteURI).ref("HEAD:" + targetBranch).tags(true).execute(); git.fetch_().from(remoteURI, remote.getFetchRefSpecs()).execute(); } catch (GitException e) {