Beefy Kasplant Posted April 22, 2020 Share Posted April 22, 2020 (edited) 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. Open Visual Studio as Administrator Open NuGet Package Manager Console 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. Log into GitHub Under the “Repositories” tab. Click the green “New” button 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. Back in Visual Studio, move into our clone folder 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. In Visual Studio, navigate back a folder 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. Open project solution of our new repository. (.sln file) Open NuGet Package Manager Console Create connection to main Intersect Repository Even though we can not push back to the main Intersect repository, lets just disable it anyways. Double check our remotes. Should see something similar, but with your information for the bottom two. 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. Open the Team Explorer window Press the “Branches” button 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) 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 Right click the branch name and select “Fetch” Rick click the branch name again and select “Merge From…” 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! Conclusion 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. Support 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 July 27, 2023 by panda Copying PDF into this thread so it is searchable and can be pinned Shenmue and Ainz Ooal Gown 2 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now