Create a pull/merge request starting from your terminal

Did you know, or even noticed?

On your first git push -u command you issue from your terminal, the git CLI offers you a link to straighly jump to creating the Pull/Merge request for your current branch on repository host platform (e.g. Github, Gitlab...)?

Try out...

git checkout -b pr-test
echo "# Testing PR" > test.md
git add test.md
git commit -m 'Add test file'
git push -u origin pr-test

You should be getting something like:

...
...
remote: To create a merge request for pr-test, visit:
remote:   https://gitlab.com/morgaan/morgan.cugerone.com/-/merge_requests/new?merge_request%5Bsource_branch%5D=pr-test
remote:
...
 * [new branch]      pr-test -> pr-test
Branch 'pr-test' set up to track remote branch 'pr-test' from 'origin'.

Now if you click the link in the console output (e.g. Cmd+click in iTerm2), you should be brought to the page to create the Pull/Merge request for that branch.