Create a Pull Request on Bitbucket from the command line

北战南征 提交于 2020-12-26 03:56:19

问题


Is there a git command to create a Pull Request directly on Bitbucket when pushing a Branch?

Or any other way to create Pull Request on Bitbucket directly from the command line or PHP


回答1:


You could use the BitBucket API and POST the right command, as in this thread:

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

That is:

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

with data:

{"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"}}}}


来源:https://stackoverflow.com/questions/52089429/create-a-pull-request-on-bitbucket-from-the-command-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!