Skip to content

Overview of the Pull Request Lifecycle

Suraj Subramanian edited this page Jul 24, 2023 · 1 revision

Like many open source projects, PyTorch uses a workflow based on pull requests. You will create a copy of the repository in your Git branch, make your changes and test it, push those changes to your fork (origin), and create a pull request (PR) against the official repo (upstream).

Prerequsities

You should have

Making your code change

  1. Find or create a new issue to work on. If your change is minor (like fixing a typo) feel free to skip this step.

  2. Create a new branch with git fetch && git checkout -b <my-branch-name> 'viable/strict' (more details on 'viable/strict').

  3. Make changes locally to the code.

  4. Test your changes locally with python ./test/test_torch.py (more details) and review other pre-commit checks.

  5. Push changes to your fork git push

    • If your changes are tracking an older version of PyTorch, rebase and push
    git pull --rebase upstream viable/strict 
    git push -f
    
  6. Create a new Github PR to propose changes from your fork into the official PyTorch repo.

  7. Review, address comments on your PR, and initiate merge along the pull request workflow.

  8. Celebrate your contributions and welcome to the PyTorch Developer community :)

Clone this wiki locally