- Download and install Unity
- Create a GitHub account (https://github.com/)
- Download and install Git (https://git-scm.com/) (don’t worry about the customization options, leave them as default)
- Open Git Bash
Navigating your file system in a command line interface like Git can be intimidating at first, but can quickly become routine.
To move to a different folder, use the cd command, short for change directory. But, like programming functions, the cd command can take arguments.
— Takes you back to the root folder.
cd folder name
— Takes you to the folder with the given name, assuming it exists.
(Tip: writing part of the folder name and hitting tab will autocomplete the folder name.)
— Takes you back to the previous folder.
— Takes you up one folder.
Alternatively you can right click in the normal folder you want to start Git in, and select “Git bash here”.
Connecting Unity and GitHub
1. Create a new repository.
2. Give it whatever name you like, and set the gitignore template to Unity.
3. Copy the marked URL
4. Create a new Unity project and navigate to it in Git Bash.
5. Navigate to the project folder as shown earlier.
6. Run the commands:
— This will initialize the git repository in the selected folder.
git remote add origin YourURL
— This connects your git repository to the project
To verify the connection, you can use the command
git remove -v, which should then respond with something similar to this.
And that’s it!
Your unity project is now connected to the GitHub repository.