我正在尝试使用 grdale grgit 从 git 签出远程分支。这是我的代码
def gitRepo = Grgit.open(dir: '.')
task checkoutBranch(){
doLast {
gitRepo.checkout(branch: 'remoteTestBranch', createBranch: false);
}
}
它失败并出现错误 "Problem check out" 。如果我已经有一个名为“remoteTestBranch”的本地分支,则此方法有效
但是当我这样做时
git checkout remoteTestBranch
从命令行,它的工作原理是
"Branch remoteTestBranch set up to track remote branch remoteTestBranch from origin.
Switched to a new branch 'remoteTestBranch'"
但是 gradle 脚本不起作用。我究竟做错了什么 ?