2

Can we create pull request through terminal or command prompt? Is there any command which we can run to create pull request and merge for:

  • Git
  • Gitlab
  • Azure

If anyone has an idea, please share it.

Biffen
  • 6,249
  • 6
  • 28
  • 36
VRAwesome
  • 4,721
  • 5
  • 27
  • 52
  • 1
    Gitlab has REST APIs to manipulate pull requests (named merge requests in Gitlab), https://docs.gitlab.com/ee/api/merge_requests.html#create-mr. You can use `curl` or Python's `requests` to call the API. You can also install `python-gitlab`, which is more user friendly, https://python-gitlab.readthedocs.io/en/stable/. – ElpieKay Nov 05 '20 at 06:27

1 Answers1

1

2020: Git itself would not create a pull request to GitLab.

Beside the API call mentioned by ElpieKay, you also have the more convenient CLI glab, and its commands:

Its latest release includes that client already pre-compiled for various platform, so you should be able to drop it in your Azure environment.


Update Dec. 2022: the project is now gitlab-org/cli, and the documentation: glab mr create.
See "How to create a GitLab merge request via command line" for the official integration.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250