有没有一条git命令可以在推送分支时直接在Bitbucket上创建Pull Request?
或者有没有其他方式可以通过命令行或PHP直接在Bitbucket上创建Pull Request?
或者有没有其他方式可以通过命令行或PHP直接在Bitbucket上创建Pull Request?
您可以使用BitBucket API并发送正确的命令,就像这个帖子中所述:
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"}}}}
您可以通过curl使用Bitbucket pull requests API:
curl https://api.bitbucket.org/2.0/repositories/my-username/my-repository/pullrequests \
-u my-username:my-password \
--request POST \
--header 'Content-Type: application/json' \
--data '{
"title": "My Title",
"source": {
"branch": {
"name": "staging"
}
}
}'
git
没有像 pull requests 这样的功能,因此这不是寻找此类功能的正确位置。但是,有一些 git 扩展可以帮助集成其他系统,例如 Bitbucket。 - Ulrich Eckhardt