Clone Unity Project to a Laptop

Lana Elfstrom
3 min readJul 19, 2023

--

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.

Gif video of hands opening a gaming laptop covered in stickers and zooming into the screen as Unity loads, opens, and transitions to a kaleidoscope.
Loading Unity onto Laptop

Step 1: Cloning the GitHub Repository:

  1. Access your project’s repository on GitHub.
  2. Click on the “Code” button and copy the SSH or HTTPS URL provided.
  3. On your laptop, open the command prompt (Terminal or Git Bash).
  4. Navigate to the directory where you want to store your project.
  5. Clone the repository by typing the following command:
Photo of a clip of code that reads “git clone repository URL. There is a space between each word of code. There are brackets around “repository URL” to indicate where the user will insert and replace with their specific repository location name.
Code to clone repository.

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:

Photo of a clip of three lines of code. The first line reads as follows: add dot. There is a space between them and it is the symbol for the dot or period, not the word. All are in lowercase. The second line reads as follows: commit -m “Commit message describing your change”, whereas you will replace it with your specific change description within the quotations. There is a space between all. The third line reads as follows: push origin main. All are lowercase and there is a space between all.
Command to fetch and merge latest changes to local project.

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:

Pull changes from GitHub repository.

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.

--

--