
If you are familiar with GitHub, you probably know that forking is a handy feature that allows you to create a copy of a repository. By default, forks on GitHub are public, meaning that anyone can see and access them. However, there are situations when you might want to keep your fork private, either for personal or security reasons.
Luckily, GitHub provides an easy way to make your fork private. By following a few simple steps, you can ensure that your code remains hidden from the public eye. First, navigate to the repository you want to fork on GitHub. Once you are on the repository page, find the “Fork” button and click on it.
After clicking the “Fork” button, GitHub will prompt you to choose where you want to fork the repository. To make your fork private, ensure that you have selected your account as the destination. Below the account selection, you will find the option to choose between making the fork private or public. Select the “Private” option, and GitHub will create a private fork of the repository for you.
It’s important to note that private forks on GitHub are only available to users with a paid subscription. If you don’t have a subscription, you will need to upgrade your account to one of the paid plans to make your fork private. Once you have made your fork private, you can start working on the code without worrying about unauthorized access.
How to Create a Private Fork on GitHub
GitHub is a popular platform used by developers to collaborate on projects and host code repositories. By default, forks on GitHub are public, meaning anyone can see and access the code. However, sometimes you may need to create a private fork to maintain confidentiality or restrict access to certain individuals or teams.
Here are the steps to create a private fork on GitHub:
- Sign in to your GitHub account: Visit https://github.com/ and sign in using your credentials.
- Find the repository to fork: Search for the repository you want to fork by visiting the user or organization’s GitHub page or by using the GitHub search functionality.
- Fork the repository: Once you have found the repository, click on the “Fork” button located at the top right corner of the page. This will create a copy of the repository under your GitHub account.
- Access your forked repository: After forking, you will be redirected to your forked repository. You can access it by visiting your GitHub profile and clicking on the repository name.
- Change the repository’s settings to private: By default, the forked repository will be public. To make it private, click on the “Settings” tab in the repository and scroll down to the “Danger Zone” section. In the “Danger Zone,” click on the “Change repository visibility” button.
- Change repository visibility: In the visibility options, select “Private” and click on the “Change repository visibility” button to save the changes.
- Invite collaborators (optional): If you want to give specific individuals or teams access to your private fork, you can invite them as collaborators. In the repository settings, click on the “Manage access” tab and search for the GitHub usernames or emails of the collaborators you want to invite. Set their access level and click on the “Add” button.
Congratulations! You have successfully created a private fork on GitHub. Now you can collaborate on the code privately and control the access to your forked repository.
Note: Remember that private forks may have limitations depending on your GitHub account type, so make sure to review the GitHub pricing and plans if you require additional features or higher privacy levels.
Step 1: Forking the Repository
Before making a private fork on GitHub, you first need to fork the original repository. Forking creates a personal copy of the repository under your GitHub account, allowing you to make changes without affecting the original repository. Here’s what you need to do:
- Navigate to the original repository on GitHub that you want to fork.
- Click on the “Fork” button in the top-right corner of the repository page.
- A dialog box will appear, asking where you want to fork the repository. Select your personal GitHub account or any other organization you have access to.
- GitHub will then create a fork of the repository under your account.
Once the fork is complete, you will be redirected to the forked repository page on your GitHub account. You now have the ability to make changes to this repository without affecting the original.
Step 2: Cloning the Forked Repository
After forking a repository on GitHub, the next step is to clone the forked repository to your local machine. Cloning a repository creates a copy of the repository on your computer, allowing you to work on it locally.
To clone the forked repository, follow these steps:
- Open a terminal or command prompt on your computer.
- Navigate to the directory where you want to clone the repository.
- Copy the URL of the forked repository from GitHub.
- In the terminal or command prompt, enter the following command:
git clone [repository URL]
Replace [repository URL]
with the URL you copied earlier.
Once the cloning process is complete, you will have a local copy of the forked repository on your machine. You can now make changes to the files, commit them, and push your changes back to the forked repository on GitHub.
In the next step, we will discuss how to set up remote tracking to keep your forked repository in sync with the original repository.
Step 3: Making the Fork Private
After you have successfully created a fork of the repository, the next step is to make it private. By default, when you create a fork on GitHub, it is set to be public, which means that anyone can see and access it.
To make your fork private, follow these steps:
- Go to your forked repository on GitHub.
- Click on the “Settings” tab, located at the top of the repository.
- Scroll down to the “Danger Zone” section.
- Click on the “Change repository visibility” button.
- Select the “Private” option.
- Click on the “Change visibility” button to confirm the change.
Once you have made your fork private, only you and any collaborators you invite will be able to see and access it. This is ideal for situations where you want to work on the code privately or share it only with selected individuals.
Note: If you have already made commits or added any code to your fork, changing the visibility to private will not delete your existing repository. It will simply make it inaccessible to the public.

Now that you have made your fork private, you can continue working on it without worrying about unauthorized access or visibility.