0

I want to add files that are being edited from one branch to other. The repository is same. How can this be done using gradle grgit. Below is some code that I wrote

def grgit = org.ajoberstar.grgit.Grgit.open(dir: "source_dir")
    grgit.add(update: true, url:"dest_dir")
    grgit.commit(message: 'adding new files')
    grgit.push()

I am not sure about the grgit.add cmd.

sver
  • 866
  • 1
  • 19
  • 44
  • Can you confirm if I'm understanding this right? Are you looking to take commits done on one branch and include them in another? If so, it sounds like you're trying to a merge. Does that sound right? – ajoberstar Aug 06 '16 at 01:13
  • Not exactly merging two branches but I am trying to move the changes only or the changed files only . – sver Aug 09 '16 at 03:47
  • Every time it should add the changed files which will be pushed only if build is successful – sver Aug 09 '16 at 04:14
  • OK, that kind of sounds like a [cherry pick](http://stackoverflow.com/questions/9339429/what-does-cherry-picking-a-commit-with-git-mean)? Does that seem more in line with what you're trying to do? – ajoberstar Aug 10 '16 at 03:25
  • How can I merge two branches? – sver Aug 17 '16 at 10:11

0 Answers0