Getting Started with GitHub Version Control System
Hi Everyone, this article is intended to serve as a brief, simple, and concise introduction the Version Control using GitHub. For anyone following along you are going to need to install Unity, Git Bash, and create a GitHub account.
Before we get started we need to do some house keeping. First off, when creating your GitHub project you need to be sure Add .gitignore and make use of the .gitignore Unity template. This is going to make it so that standard use unity files are not uploaded.
Next we need to go into Git Bash and run the following line of code. This will change the default branch to be called main instead of master. This is important for the sake of the naming conventions in your local environment being consistent with everyone else’s and with GitHub.
Now in git Bash you are going to need to change directory using the cd command to go to your Unity Project. The we are going to a series of commands to out the code within our project onto GitHub. We start by initializing the directory using “git init”. Then we can link our to Git hub using “git remote add origin”.
Next we need to use “git pull origin main” and then “git add” in order to prepare specific Unity files to be submitted.
Lastly we can use the “git commit” and “git push” commands to commit our file changes to the branch and push it GitHub.
Now you can check out your GitHub page and see all of the files that you have uploaded. Always remember that when updating you files in the future you to Pull, Commit, then Push.