Read Anthropic’s case study about Graphite Reviewer

How to create and manage pull requests from a forked repository

Sara Verdi
Sara Verdi
Graphite software engineer
Try Graphite


Note

This guide explains this concept in vanilla Git. For Graphite documentation, see our CLI docs.


Contributing to projects by forking repositories and submitting pull requests is a a key part of collaborative software development. This guide will walk you through the steps of creating and managing pull requests from a forked repository, and how using Graphite's PR inbox can help you enhance your PR management with Graphite PR inbox.

A fork is a copy of a repository that allows you to freely experiment with changes without affecting the original project. Most commonly, forks are used to propose changes to someone else's project or to use as a starting point for your own idea.

  1. Fork the repository: Start by forking the repository you want to contribute to. This is done by clicking the 'Fork' button on the repository's page on GitHub.

  2. Clone your fork: Next, clone your fork to your local machine with the following Git command:

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

    Replace yourusername and repository-name with your GitHub username and the name of your forked repository.

  3. Create a new branch: Before making your changes, create a new branch in your local repository:

    Terminal
    git checkout -b your-feature-branch

    It's a best practice to name your branch something relevant to the changes you plan to make.

  4. Make changes and commit: After making your changes, commit them with:

    Terminal
    git commit -am "Add your detailed commit message"

    Ensure your commit message is clear and descriptive.

  5. Push your branch: Push your branch and changes to your GitHub fork:

    Terminal
    git push origin your-feature-branch
  6. Create the pull request: Navigate to the original repository on GitHub, and you'll likely see a "Compare & pull request" button. Click it, and adjust the pull request details as needed. If you don't see this button, you can go to the "Pull Requests" tab and click "New pull request", and select your branch.

The Graphite PR inbox acts like an email client for your pull requests, helping you stay organized and aware of PRs that need your attention. Here's how you can integrate it into your workflow:

  • Setting up your inbox: Log into Graphite and set up your pull request inbox to track repositories. You can configure up to three default repositories on the free tier, and up to 30 on the Team and Enterprise tiers.
  • Organize PRs with custom sections: Create new sections or edit existing ones in your inbox to categorize pull requests based on their status such as 'Needs your review', 'Approved', or 'Merging'.
  • Share configurations: Share your inbox configurations with teammates to maintain a unified workflow, using the 'Share filters' feature which allows others to import your settings with a single link.

screenshot of pr inbox

Utilize the cmd + k shortcut or the search bar in your PR inbox to quickly find pull requests across all your synced repositories. This feature supports fuzzy search across PR titles, descriptions, authors, and more, making it easy to manage large numbers of pull requests efficiently.

By following these steps and utilizing tools like GitHub and Graphite's PR Inbox, you can streamline the process of creating and managing pull requests from a forked repository. This not only helps in maintaining a clean and organized workflow but also enhances collaboration and efficiency in your projects.

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