从命令行在Bitbucket上创建一个Pull请求

问题描述 投票:1回答:1

是否有一个git命令在推送分支时直接在Bitbucket上创建Pull Request

或者直接从命令行或PHP在Bitbucket上创建Pull Request的任何其他方法

git command-line bitbucket pull-request
1个回答
1
投票

你可以使用BitBucket API和POST右命令,as in this thread

POST /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests

那是:

curl -u user:myPW -H "Content-Type: application/jso https://bitbucket.server.com/rest/api/1.0/projects/myProject/repos/myRepo/pull-requests -X POST --data @req.json

有数据:

{"title":"test","description":"test","fromRef":{"id":"refs/heads/test-branch","repository":{"slug":"test-repo","name":null,"project":{"key":"myProject"}}},"toRef":{"id":"refs/heads/master","repository":{"slug":"myRepo","name":null,"project":{"key":"MyProj"}}}}
© www.soinside.com 2019 - 2024. All rights reserved.