-1

I have a repository on github and have created a branch. I am able to create a new local repository on my machine and clone from the main repository.

I now want to make some changes to the code and push to the main repository.

I have run through the steps, git status to check files, git add ., git commit -m "", and finally git push origin <branch_name>.

How do I make a pull request via the command line to the main branch of my repository so that a pull request can be seen for the main branch?

Patrick
  • 2,044
  • 1
  • 25
  • 44
HappyZeneca
  • 9
  • 1
  • 1

1 Answers1

0

For the github's web interface, it's pretty straighforward and explained at best from their docs:

Creating a pull request.


Yet since you said you want to create the PR via the cli, you also need to install the official github cli:

https://cli.github.com/

After installation for your OS you need to authenticate:

gh auth login

You have different options, I'd say the ssh is the most developer-friendly approach. You also have to provide an authentication token, yet the prompts are self-explantory.

When you then are inside your git checkout folder, you can then create a pull request for your currently checked out branch via:

gh pr create

For further details, see gh's docs about pr creation.

k0pernikus
  • 60,309
  • 67
  • 216
  • 347