'How to get a project from Github to Unity
I'm new to both unity and github, how would I go about getting a unity project my group has been working on from github to Unity? I apologize if this is a simplistic question my google searches didn't turn up much.
Solution 1:[1]
@Roberto's answer presupposes that you are familiar with GitHub / the command line.
If you aren't and aren't planning to continue to use GitHub for collaboration, you could also just download a zip archive of the repository (= the project's main "directory"). You'll find a "Download ZIP" button on the righthand side of the repository's main page.
See also:
How do I download code from this github site
How do I clone a github project to run locally?
Solution 2:[2]
This can be a little intimidating for new gamedev's who have not been using source control.
Install some sort of tool that supports git. There are two flavors : command line tools and GUI tools. Some examples would be gitbash, github for windows, or mac os X developer tools includes a git commandline as well. In my experience many documentation examples seem to refer to command line as it is more universal across computing platforms so you may want to use that even if it seems 'harder' at first. The rest of my instructions assume you use a command line tool.
Get the URL for the code to clone. Navigate in a web browser to the code repository (on Github, Bitbucket, or wherever it is). Usually in the upper right hand corner is a download or clone button. Often it has a drop down arrow that will allow you to get a URL or a zip download. If you want to actively participate in submitting code grab the URL and proceed to the next step. If you just want to download it once and check it out for fun grab the zip.
Clone the repo in your command line tool Open your command line tool. Navigate to a folder that you wish to store source code in such as C:\source or D:\repos using the cd commands (you may wish to google this if your not familiar with it as it varies a tiny bit between platforms and the command line you may be using) Now you want to execute the clone command. Some git repos will have included the clone command in the url you copied, others will not. The end command will look similar to this
git clone https://github.com/someguy/SomeGameProject.git FolderIWantItToGoIn
Hit enter, and it will clone the project. This may take a few minutes if the game project has large files it may take a bit longer.
- Potential large assets work arounds In some cases projects have some very large assets they do not commit to source code. If so you should receive special instructions where to download those.
Hopefully those file instructions are detailed, but if they only mention where to get the files then after step 3 download the files and insert them into the folder under Assets/ will usually be the correct thing to do.
Open UnityHub and open the project in the appropriate version of Unity 3d. Note that many projects choose a particular version of Unity. Hopefully your team told you what version to use. If not check in the folder you made under ProjectSettings/ProjectVersion.txt . In this file it will say what version of unity was used like this:
m_EditorVersion: 2020.3.8f1
So in Unity Hub click "Add" and select the folder you cloned the project into. This will return you to the Projects view. In the projects view select the version noted above in the "Unity version" column with a small grey triangle drop down.
Then click on the project name to open it.
In Unity, go to the Assets menu and select "Open C# Project" and make sure that your code editor loads without error.
Finally, in Unity 3d, open whatever scene file is indicated as the one you should work in and hit Play at the top and you should be able to play the game without error (assuming they checked it in with no errors of course).
Solution 3:[3]
In case if you are looking for JAR files of all the dependencies you have in android project. Assuming you have added needed dependencies in you build gradle file(including your github projects), Compile/Make once and Look at Project->External libraries in android studio. You will find list of all downloaded jar files, Copy those and paste it in Unity assets/android/libs path.
Solution 4:[4]
- Open up your github repository like https://github.com/*Yourname*/*YourGame*
- Then click Code=>Download Zip
- Then unzip folder
- After that Open up UnityHub and and select open project
or
- Open Unity then click File=> Open Project
- Then chose your project folder that it.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Kay |
| Solution 2 | Carl Kidwell |
| Solution 3 | virtplay |
| Solution 4 | ouflak |
