Graphite Reviewer is now Diamond

Creating pull requests without forking in GitHub

Sara Verdi
Sara Verdi
Graphite software engineer
Try Graphite

Pull requests are a key part of the GitHub workflow, typically involving a fork when you need to contribute to a repository where you don't have write access. However, for teams and contributors with direct access to the repository, creating pull requests without forking simplifies the process, allowing for quicker updates and easier management of changes. This guide will show you how to create pull requests in GitHub without forking.

A pull request (PR) without a fork involves creating and submitting a PR from a branch within the original repository, not a copy or fork. This method is commonly used by teams with access permissions to the same repository, facilitating a better collaboration process.

  1. Clone the repository: Start by cloning the repository directly to your local machine using the command:

    Terminal
    git clone https://github.com/your-username/repository-name.git

    Replace your-username and repository-name with the actual username and repository.

  2. Create a new branch: After cloning, navigate into the repository’s directory and create a new branch for your changes:

    Terminal
    git checkout -b your-branch-name

    Replace your-branch-name with a meaningful name related to the changes you intend to make.

  3. Make your changes and commit them: Once on your branch, make the necessary modifications or additions to the codebase and commit these changes:

    Terminal
    git add .
    git commit -m "Add a descriptive commit message"
  4. Push the branch to GitHub: With your changes committed, push the branch to GitHub:

    Terminal
    git push origin your-branch-name
  5. Create the pull request: Go to the repository on GitHub, where you’ll find a prompt to create a pull request from your newly pushed branch. Click on 'Compare & pull request', add a description of your changes, and submit the PR for review.

Graphite's Command Line Interface (CLI) offers a strong solution for managing pull requests by automating common git commands into singular, streamlined operations. This integration not only saves time but also reduces the cognitive load, making it easier to focus on coding rather than process management. Here are the precise ways the Graphite CLI enhances your pull request workflow:

  • Streamlined branch management: With the gt create command, you can effortlessly create a new branch, commit your changes, and switch to the new branch in one step, eliminating the need for multiple commands and minimizing the chance for errors.

  • Enhanced productivity: The CLI reduces context switching by allowing you to stay in your development environment. This means you can make, commit, and submit changes without leaving your terminal, speeding up your workflow significantly.

  • Easy access to PRs: After creating your pull request with gt submit, the CLI provides a URL directly in the terminal, giving you instant access to the pull request in your browser. This makes it easy to share with team members or review the PR yourself.

  • Integrated code review process: When it comes time to address feedback, the CLI's gt modify command streamlines the update process. You can amend existing commits or add new ones based on the feedback, and resubmit the changes to GitHub with minimal effort.

By integrating these CLI tools into your workflow, you can maintain a high level of efficiency and organization, reducing the overhead typically associated with pull request management. This not only speeds up the development process but also enhances collaboration by making it easier to handle revisions and track the status of various changes.

For teams looking to simplify their workflows, creating PRs without a fork is a straightforward approach that, when combined with tools like Graphite's CLI, can increase productivity and collaboration.

Git inspired
Graphite's CLI and VS Code extension make working with Git effortless.
Learn more

Built for the world's fastest engineering teams, now available for everyone