Jump to content

How To Create A Private Fork For Intersect - Protecting Your Private Customizations!

Beefy Kasplant

Recommended Posts

Available in PDF format here: https://kasplant.itch.io/kash-shop-private-repo

The Issue

How forks currently work with GitHub, when you fork a public repository, you cannot make your fork private. Why is this an issue? Well, when you create a fork from the Intersect repository, the entire code to your game is made public. Not only is this of course a security risk, but any systems and code unique to your game is now available for others to obtain.



There Is A Solution!

There is no need to worry! There is a work around for this problem! With a few simple steps you can protect your code. This tutorial will walk you through making a making a private fork of Intersect, but still allow you to pull code changes from the Intersect main repository to stay up to date.

Getting Started

First, we need to do a little setup work.

  1. Open Visual Studio as Administrator

  2. Open NuGet Package Manager Console

  3. Set directory of where you want your project files on your computer. Example:


Create A Bare Clone

Now that we are looking in the right place, lets setup our private fork. First lets setup a bare clone. This will be deleted later.


You should now see a folder named “Intersect-Engine.git” in the directory.

Create A Private Repository

Now create a private repository through GitHub. This will be where your code will be stored.

  1. Log into GitHub

  2. Under the “Repositories” tab. Click the green “New” button

  3. Set the repository name to the name of your game and mark it as public. Then press the green “Create Repository” button at the bottom.

Connect Temporary Clone with Repository

This step is where most of the magic happens. We are going to push our clone into our new private repository so GitHub will treat our new private repository as a clone.

  1. Back in Visual Studio, move into our clone folder

  2. Now push the clone into our new repository

Format: git push –mirror https://github.com/<your_username>/<repo_name>.git

If you look at your repository on GitHub. You should now see all the Intersect Engine source code in your new private repository.

Remove Temporary Repository

As mentioned earlier, it is now time to delete the bare clone as it has served its purpose.

  1. In Visual Studio, navigate back a folder

  2. Delete temporary clone. Type “A” and press the ENTER key.

    Copying Repository to Local

    Now its time to pull our source code to our machine.

    Format: git clone https://github.com/<your_username>/<repo_name>.git

    You should now see your repository copied into your directory.

    Preparing for Future Updates

    Since Intersect is still in development. We want to stay up to date and pull all future changes to the engine. To do this, we have to tell git where to pull from.

    1. Open project solution of our new repository. (.sln file)

    2. Open NuGet Package Manager Console

    3. Create connection to main Intersect Repository

    4. Even though we can not push back to the main Intersect repository, lets just disable it anyways.

    5. Double check our remotes.

      Should see something similar, but with your information for the bottom two.

    6. Do initializing fetch to the main Intersect repository

You did it! You now have a private fork!

How To Pull Future Updates

Since Intersect is in development, pulling changes and staying up to date is important. Here are the steps to pulling changes into your project.

  1. Open the Team Explorer window

  2. Press the “Branches” button

  3. Make sure you are on the right branch you want to pull changes into. In this case we will stay on the Master (Stable) branch. (Highlighted branch, double click to switch)

  4. You will see in your remotes folder; you have two other folders.

    “origin” is your GitHub repository connection/branches

    “mainstream” is the GitHub main Intersect repository connection/branches

  5. Right click the branch name and select “Fetch”

  6. Rick click the branch name again and select “Merge From…”

  7. In the “Merge from branch:” select “mainstream/master” in this case since we want to pull changes from master branch in the main Intersect repository.

NOTE: Pay attention to the “Commit changes after merging” check box. It is up to you and your current development if you wish to commit not only the changes you just pulled from master, but any changes you may currently have in your solution.

Your branch is now up to date with the Intersect main repository!


Thank you for following along with this tutorial. In this tutorial you have created a private repository/fork of Intersect Engine GitHub source and established connections back to the main repository. It also explained how to pull new changes into your project to stay up to date with the development of the Intersect Engine. Your source code is now protected from unwanted viewing eyes and to keep your development private.


If you have questions, join our Kash Shop Support discord

Our Itch.io Store

We are constantly working on new patches and source code updates for Intersect. Check out our store at https://kasplant.itch.io

Edited by panda
Copying PDF into this thread so it is searchable and can be pinned
Link to comment
Share on other sites

  • panda changed the title to How To Create A Private Fork For Intersect - Protecting Your Private Customizations!
  • panda pinned this topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...