How To Add An Existing Unity Project To Github
Objective: Add Existing Unity Project To Github using Git Commands
Create A Repo On GitHub
First you need to create a repository on GitHub. Name it whatever you like and give it a description. See my example below:
Upload Existing Project To Newly Created Repo
Navigate to your directory on your computer using the console (I use Git Bash). You would use the command line to cd (Change Directory) into the directory.
Once in the directory of your existing project proceed to execute the following commands below:
Initialize Git (Version Control)
git init
Create a .gitignore File for Unity
vi .gitignore
You can find the latest gitignore content for Unity here: https://github.com/github/gitignore/blob/master/Unity.gitignore
Copy and paste the syntax into the console and then type the following to close the creation of the gitignore file.
:wq
Add All Your Files To Be Monitored
git add .
Commit All Your Files With A Note
git commit -m “Initial Commit”
Point Git To Your Existing Repo URL
git remote add origin <project url on github>
Verify That Your Repo Is Connected
git remote -v
Push Changes To GitHub Repo
git push origin master
That's it! You Existing Unity Project Should now be uploaded to your GitHub repo. This would also work the same way if you use another repo services such as Bitbucket.