Creating a New Git Remote - HackerN64/HackerSM64 GitHub Wiki

In case you need to back up your repository, put it on another computer, or show it to someone else, you're going to need it to be saved online. Every Git repository is linked to an online copy known as a remote. For example, the main HackerSM64 webpage itself is a remote. This HackerSM64 remote is what your local repository is set to use by default, which is something you do not want. Basically, Git thinks that you're making changes to HackerSM64 itself, and when you try to put it online, it'll want to put the changes specific to your hack onto the base HackerSM64 repository that everybody uses. So, you're going to want to make your own GitHub page for this.

First off, make sure that you have an account on GitHub. Once you've created an account, the very first thing you will need to do is configure an SSH key for the account. Please follow this tutorial to generate a new SSH key for your terminal, and then follow this tutorial to add your newly generated SSH key to GitHub. Make sure you have the correct operating system type selected, as it does not necessarily correlate to the operating system your host machine runs on (for example, if you installed the Ubuntu terminal using WSL, you should select "Linux" instead of "Windows"). These steps are mandatory, as GitHub does not allow you to use username/password authentication when committing to a repository.

Once you've set up your SSH keys, you can create a new GitHub repository. Click on the + in the upper right hand side of the screen, and click New Repository.

image

You'll be greeted with the "Create a new repository" page. Simply give your repository a name, a description, and mark it as either Public or Private. If it's public, anyone will be able to see your repository and make their own version of it, so choose whichever you're most comfortable with. You can make it private for now and make it public after your hack is released, if you want it to be open source.

Leave the other configuration fields alone, as you want this to start as a completely empty repository.

image

If you've done everything right, you should see the following header:

image

Copy the URL displayed here to your clipboard. You will be using this as the link to your new remote.

Return to your terminal, and make sure you're in the base directory of your local repository (such as ~/SM64/<name of project>). Enter the command git remote set-url origin <remote url>, pasting in the URL you copied before in place of <remote url> using a right-click.

Next up, simply run git push in the terminal. If everything is set up correctly and you've configured your SSH key properly, you should see your changes being uploaded to your new location. When it's done, you should be able to refresh the webpage and see your project!

image

Congratulations, you have successfully backed up your repository! However, you will still need to commit to it very regularly as you make new changes to your project, not unlike regularly saving a document in case your computer crashes or something else unexpected happens. For more Git usage tips on how to do this, check out the "Hacking Pro Tips" tab on the sidebar, or better yet take a look at other external Git resources or usage tutorials! Git is a very common tool used across almost all modern software development, and will be covered in-depth all over the web. Most beginner resources you find will still be very applicable to a romhacking project, while also being much more fleshed out than what we are able to cover here.

Previous
Setting up a Hack Repository

Creating a New Git Remote
Installing HackerSM64

                                                                                                                  
Exit
Back to Wiki Home
⚠️ **GitHub.com Fallback** ⚠️