Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pull request from same repository

Tags:

I want to protect my master branch so my team cannot directly merge their code to it without approval.

Is it possible to do a pull request from a branch inside the parent repository?

I know if someone forks the repo they can then do a pull request but my workflow is that we commit to a branch on the main repository first that is assigned to a deployment slot for testing. I am not worried about protecting these branches as they just deploy to testing slots.

My master branch deploys to production so I want some way for team member to request their branch be merged to master.

Is there anyway to generate a pull request between branches? What workflow would you suggest?

like image 437
Guerrilla Avatar asked Mar 07 '19 16:03

Guerrilla


People also ask

How do I create a pull request for the same repo?

Once you've committed changes to your local copy of the repository, click the Create Pull Request icon. Check that the local branch and repository you're merging from, and the remote branch and repository you're merging into, are correct. Then give the pull request a title and a description. Click Create.

Can I raise 2 pull requests from same branch?

There can be only one open PR from a given branch.

Do you need a new branch for a pull request?

Creating a Pull Request To create a pull request, you must have changes committed to the your new branch. Go to the repository page on github. And click on "Pull Request" button in the repo header.

Can I clone a pull request?

The short answer for cloning a pull request is, you can't simply clone a pull request.


1 Answers

You can protect the master branch in the branch settings so that no one can push commits to the master branch.

you end up having multiple branches in your main repo based on their purpose:

  1. master branch(branch you use to build in production)
  2. staging branch(Branch you use to make tests in the staging environment)
  3. feature branch(Where you actually code)

Name of the above branches is not strict, can be named according to relevance

So once you are done implementing your feature/fix/development you make a pull request to staging branch where the testers will test your branch. Once the testing is done and you want to move to production you make a pull request to master and merge.

like image 62
Harish Barma Avatar answered Nov 15 '22 03:11

Harish Barma