Home > Blockchain >  how to post a github PR that sets the base branch to release_
how to post a github PR that sets the base branch to release_

Time:08-31

Developers keep making the mistake on hotfixes to release branches in github. Here are the steps we have right now

  • git checkout --track origin/release_xxxx (make sure you are on the release branch)
  • git checkout -b yourName/yourTicketNumber (the hotfix branch)
  • Modify your code
  • Post a PR
  • modify the PR's base branch back to release_xxx

I am wondering if there is a slick way on the last step that once in a while gets missed to automatically use the branch it was branched from instead of main?

Perhaps I just need to create a postHotfix.sh and do the work in there but then people need github tools installed. Any other solutions?

CodePudding user response:

I don't know of an automatic solution, but you can change the base branch when raising your PR in the GitHub UI:

Change the "base" option to the branch you want

If you're using the GitHub CLI, you can add a -B (or --base) branch as an argument: https://cli.github.com/manual/gh_pr_create

  • Related