Setting Up Git

Objective: Configure Git repository to be used in Unity.
Git is a space for collaboration and the maintenance of a project’s code. In order to use this space, we will need to connect it to said project.
To begin, let’s create a new project within Unity.

Open up Unity Hub and select New.
A popup window will appear asking you to detail the specifics of this project.

Edit the name and file location and select Create.
After your project has been created. Head over to GitHub. The page will look as shown.

You’ll need to create a new repository before linking Git to the project. That said, on the homepage click New.

Once inside, edit the Repository Name and Description as you see fit.

After you’ve selected and name, you have the option of making repository Public or Private, add a README or .gitignore file, or choose any license that may apply.

For this example, we will be adding a .gitignore file.

Select Unity as there are files within the program that aren’t necessary to commit when working with a team.
Select Create Repository once you’ve completed this step.

You are now ready to link Git to your project!
You’ll need to initialize Git inside your project to get started. To do so, navigate to your project within Git Bash.

Once inside, type command: git init and press enter on your keyboard.

After initialization is completed, head back to GitHub copy the link to your repository from the Code menu.

Once copied, head back over to Git Bash and type : git remote add origin. Paste the link to the end of the command line and press enter on the keyboard.
To verify that your project has been linked to the remote server, type: git remote -v.

With that, your project is now linked to Git!