Set up Unity Project with git
本文最后更新于 2023年8月22日 下午
1. Install Unity
use 2022 LTS version, 3D
2. Configure Git
2.1 Install Git
If you haven’t already, install Git on your system. Visit the official Git website and follow the installation instructions based on your operating system.
we could use git-lfs to manage large binary file, so install it
2.2 Initialize Git Repository
Open the terminal or command prompt in the root directory of your Unity project. To do this, navigate to the project’s root directory.
2.3 Initialize Git
Run the following command to initialize a Git repository for your project:
1 | |
This will create a new Git repository in your project’s directory.
2.4 Set Git User Name and Email
Configure your Git username and email address by running the following commands:
1 | |
Replace “Your Name” with your desired username and “your@email.com“ with your actual email address.
3. Connect to a Remote Git Repository
To collaborate with others and store your project on a remote Git repository (such as GitHub), you need to connect your local repository to the remote repository.
3.2 Add Remote Repository
Run the following command to add the remote repository as the origin:
1 | |
3.3 tracking remote repo
1 | |
``
``