我想将一个分支的更改添加到同一个 repo 中的另一个分支。我不确定这是否意味着将第一个分支合并到第二个分支中。所以,我尝试了这个
def grgit = org.ajoberstar.grgit.Grgit.open(dir: project.parent.projectDir)
grgit.checkout(branch: 'test_dest')
grgit.fetch()
grgit.merge(head: 'master')
grgit.push()
但是当我执行任务时,我得到一个错误'没有为修订字符串找到提交'。任何指针,我怎样才能使这项工作
堆栈跟踪 :
Caused by: org.ajoberstar.grgit.exception.GrgitException: No commit found for revision string: test_dest
at org.ajoberstar.grgit.util.JGitUtil.resolveObject(JGitUtil.groovy:62)
at org.ajoberstar.grgit.util.JGitUtil$resolveObject$0.call(Unknown Source)
at org.ajoberstar.grgit.operation.MergeOp.call(MergeOp.groovy:84)
at org.ajoberstar.grgit.operation.MergeOp.call(MergeOp.groovy)
at java_util_concurrent_Callable$call.call(Unknown Source)
at java_util_concurrent_Callable$call.call(Unknown Source)
at org.ajoberstar.grgit.util.OpSyntaxUtil.tryOp(OpSyntaxUtil.groovy:45)
at org.ajoberstar.grgit.Grgit.methodMissing(Grgit.groovy:188)
at com.vitalconnect.gradle.tasks.PushChangesTask.pushToDest(PushChangesTask.groovy:28)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:227)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:220)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:209)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:585)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:568)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 60 more