How to create pull requests in GitHub
Pull requests facilitate code review, discussion, and controlled integration of changes in collaborative software development workflows. As the creator of CoreUI, a widely used open-source UI library, I’ve created and reviewed thousands of pull requests throughout my 25 years of development experience. The most effective approach is pushing feature branches to GitHub and creating pull requests through the web interface with clear descriptions. This method enables comprehensive code review, automated testing, and maintains clean project history through structured merge workflows.
Push feature branch to remote, create pull request via GitHub interface with descriptive title and details.
# Create and checkout feature branch
git checkout -b feature/add-user-authentication
# Make changes and commit
git add .
git commit -m "Add JWT authentication for user login"
# Push branch to remote
git push -u origin feature/add-user-authentication
# The output will include a URL to create PR directly:
# remote: Create a pull request for 'feature/add-user-authentication' on GitHub by visiting:
# remote: https://github.com/username/repo/pull/new/feature/add-user-authentication
After pushing, navigate to GitHub repository and:
- Click “Compare & pull request” button that appears
- Select base branch (usually
mainormaster) and compare branch (your feature branch) - Add descriptive title: “Add JWT authentication for user login”
- Write detailed description:
- What changes were made
- Why these changes are necessary
- How to test the changes
- Related issues (e.g., “Closes #123”)
- Request reviewers from your team
- Add labels (feature, enhancement, bug fix, etc.)
- Link related issues
- Click “Create pull request”
Alternatively, use GitHub CLI:
# Create PR with title and body
gh pr create --title "Add JWT authentication" --body "Implements JWT-based authentication system with refresh tokens. Closes #123"
# Create PR interactively
gh pr create
# Create PR with specific base branch
gh pr create --base main --head feature/add-user-authentication
Here the feature branch isolates your changes from the main codebase until reviewed. Pushing with -u flag sets upstream tracking for easier future pushes. The PR description provides context helping reviewers understand changes quickly. Linking issues with “Closes #123” automatically closes related issues when PR merges. GitHub CLI streamlines PR creation from command line without switching to browser. Requesting reviewers ensures appropriate team members evaluate changes before merging.
Best Practice Note:
This is the pull request workflow we use in CoreUI open-source development for maintaining code quality and collaborative review. Keep PRs focused on single features or fixes for easier review, write comprehensive descriptions with screenshots for UI changes, enable “Allow edits from maintainers” for open-source contributions, and use draft PRs for work-in-progress to gather early feedback before formal review.



