Skip to main content
In this guide, you’ll learn how to safely experiment with a project by creating a personal copy of an Azure DevOps repository. Forking enables you to develop features, test changes, and submit pull requests back to the original codebase—all without affecting the upstream repository. This workflow is perfect for open source contributions and large-team collaboration.

1. Forking a Repository

  1. Sign in to Azure DevOps as your user (e.g., Lloyd).
  2. Navigate to Repos and locate the KodeKloud GIFs repository.
  3. Click Fork, name your fork (for example, KodeKloudGifts.LloydChristmas), choose the branches to include, and confirm.
The image shows an Azure DevOps repository interface for "KodeKloudGifts," displaying a list of files and a dialog box for forking the repository.
Forks are isolated copies—your changes won’t affect the original repository until you open a pull request.
After the fork completes, the Clone button points to your new repository:
The image shows an Azure DevOps repository interface with a list of files and a "Clone Repository" dialog box open, displaying options for cloning via HTTPS or SSH.

2. Cloning and Setting Up Your Fork

Use Git to clone your fork, not the original:
Sample output:
After cloning, run the following to set up the original repo as upstream:
Open your project in Visual Studio Code:
The image shows the Visual Studio Code interface with a project open, displaying the Explorer panel on the left and the Welcome page with start options and walkthroughs on the right.

3. Modifying the Code

Edit Pages/Home.razor to showcase Lloyd’s GIF shop:
Commit and push your updates:

4. Comparing Fork vs. Upstream

Switch between your fork and the upstream repository in Azure DevOps to verify changes:
The image shows an Azure DevOps repository interface with a project named "KodeKloudGifts." It displays a list of files under the "Pages" directory, including "Counter.razor," "Home.razor," and "Weather.razor."
Your fork’s Home.razor now reflects the new content, while the upstream remains unchanged.

5. Creating a Pull Request

When you’re ready to merge, create a pull request:
  1. In your fork, go to Pull Requests > New Pull Request.
  2. Select master (or your feature branch) as both source and target, if applicable.
  3. Add a descriptive title and summary.
The image shows a pull request creation page on Azure DevOps, with fields for title, description, and reviewers. The title and description are filled with "Changing front page."
Tag reviewers, link work items, and adjust settings:
The image shows a pull request creation page on Azure DevOps, with fields for title, description, and reviewers. The description mentions a change to a Python app.
Once submitted, maintainers can review and merge your contribution.

Workflow Summary

Watch Video