curl -H "Accept: application/vnd.github.v3.diff" -u [username]:[personal_access_token] https://api.github.com/repos/[organization]/[repo]/pulls/[pull id] > pr.diff
Replace
username
your Github usernamepersonal_access_token
can be generated under https://github.com/settings/tokensorganization
name of the organizationrepo
name of the repositorypull id
ID of the pull request
To export this https://github.com/proxify-ab/proxify-app-platforms/pull/4746
the following code is used
curl -H "Accept: application/vnd.github.v3.diff" -u viktorjarnheimer:SECRET https://api.github.com/repos/proxify-ab/proxify-app-platforms/pulls/4746 > pr.diff
curl -u [username]:[app_password] https://bitbucket.org/api/2.0/repositories/[workspace]/[repo_slug]/pullrequests/[pull id]/diff > pr.diff
Replace:
username
with your Bitbucket usernameapp_password
with your Bitbucket app password (which can be generated under App Passwords)workspace
with the workspace ID or username for the repositoryrepo_slug
with the slug of the repository (the name in lowercase, with spaces replaced by hyphens)pull id
with the ID of the pull request
To export this pull request: https://bitbucket.org/proxify-ab/proxify-app-platforms/pull-requests/4746
The following code is used:
curl -u jarnheimer:SECRET https://bitbucket.org/api/2.0/repositories/proxify-ab/proxify-app-platforms/pullrequests/4746/diff > pr.diff