Clone Unity Project to a Laptop
This is really just a re-do of my original post explaining how to set up your project on your desktop with some slight differences, as we are cloning from the desktop rather than setting up an original repository and project files. I thought it might serve as a useful reminder.
Step 1: Cloning the GitHub Repository:
- Access your project’s repository on GitHub.
- Click on the “Code” button and copy the SSH or HTTPS URL provided.
- On your laptop, open the command prompt (Terminal or Git Bash).
- Navigate to the directory where you want to store your project.
- Clone the repository by typing the following command:
Replace `<repository_URL>` with the copied URL from Step 2.
6. Press Enter and wait for the cloning process to complete.
Step 2: Setting Up the Project on Your Laptop:
1. Open Unity on your laptop.
2. Click “Open” or “Load Project” in the Unity Hub.
3. Navigate to the directory where you cloned the repository in Step 1.
4. Select the project folder and click on “Open.”
5. Unity will load the project, and you can start working on it.
Step 3: Setting Up the Project on Your Desktop:
1. Repeat 2–5 from Step 2, ensuring you navigate to the same directory where you cloned the repository.
2. Unity will load the project on your desktop, allowing you to work on it.
Step 4: Synchronizing Changes Between Devices:
1. When you finish working on your project on one device (e.g., laptop), commit and push your changes to the GitHub repository.
- Open the command prompt in the project directory.
- Use the following commands to commit and push your changes:
2. Open the command prompt in the project directory on the other device (e.g., desktop).
3. To pull the latest changes from the GitHub repository, use the following command:
This command will fetch and merge the latest changes into your local project.
Remember to commit and push your changes to the GitHub repository from one device and pull the latest changes on the other to keep them in sync.