【发布时间】:2017-03-19 11:28:14
【问题描述】:
背景
我想确保推送分支上的所有提交消息都有时间登录
即。 add readme /spend 5m
问题
我想获取 bitbucket 管道中两个 git 分支之间的提交差异,
这是我的 yaml 管道配置:
pipelines:
default:
- step:
script:
- git log $BITBUCKET_BRANCH --oneline --not master
$BITBUCKET_BRANCH 是管道正在作用的分支。
但管道在尝试与 master 比较时返回错误
+ git log $BITBUCKET_BRANCH --oneline --not master
fatal: ambiguous argument 'master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
注意管道中的设置步骤(这是bitbucket预定义的,我无法更改)
git clone --branch="abdullah-s/bitbucketpipelinesyml-created-online-wit-1489917130851" --depth 50 https://x-token-auth:$REPOSITORY_OAUTH_ACCESS_TOKEN@bitbucket.org/abdullah-s/webook.git $BUILD_DIR;
git reset --hard ac61f080a28428bdd885735374164577a2b0aa43;
git remote set-url origin git@bitbucket.org:abdullah-s/webook.git
在设置的第一个命令中,bitbucket 仅从我的存储库中克隆一个分支
我尝试了什么
我试图拉大师
- git checkout -b master
- git pull origin master
- git log $BITBUCKET_BRANCH --oneline --not master
但出现错误
+ git pull origin master
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
问题
如何比较 bitbucket 管道中的两个分支?
【问题讨论】: