grgit - Adding commit from one branch to another in a gradle task -
my requirement add last commit of branch 'a' branch 'b'. did research , found out 'cherry picking' can solution this.i want write gradle task doing operation. so, this:
task copycommits() <<{ def grgit = org.ajoberstar.grgit.grgit.open(dir: project.parent.projectdir) grgit.checkout(branch: 'b') 'git cherry-pick 2133467'.execute().text.trim()
}
branch local branch. above task doesn't perform required operation.
i not able use cherry-pick here since want push commits other branch. worked me here:
task pushchanges() <<{ def grgit = org.ajoberstar.grgit.grgit.open(dir: project.parent.projectdir) 'git push origin a:b'.execute().text.trim() }
Comments
Post a Comment