Skip to content

How to Create Pull Request / Commit #1152

Answered by akashRindhe
AteroConfigs asked this question in Q&A
Discussion options

You must be logged in to vote

A pull request and a commit are quite different from each other, so it looks like you have two separate questions. I'm addressing the pull request question below -

Given you have an existing GitHub repository with a base branch main and a new-feature branch with commits, you can create a pull request to merge your new-feature branch into your main branch with the following code -

GHRepository repo = gitHub.getOrganization("AteroConfigs").getRepository("repo-name-here");
String prTitle = "Adding new feature ABC";
String prDescriptionInMarkdown = ## PR Description goes here"
GHPullRequest pullRequest = repo.createPullRequest(prTitle, "new-feature", "main", prDescriptionInMarkdown);

If you w…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@Verschwiegener
Comment options

@Verschwiegener
Comment options

@akashRindhe
Comment options

@Verschwiegener
Comment options

@Verschwiegener
Comment options

Answer selected by bitwiseman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants