Git With The Program

Mike Brisson
3 min readMar 25, 2021

--

How to install git for Unity and other developers

One of the most important tools in any developers kit is git. Whether you are working solo or in a group, git is essential!

Let’s get you up to speed. You can download git here and once you have installed it on your computer, you are ready for the next steps.

If you haven’t already, create an account on github.com and create a new repository.

It’s important to add a .gitignore so you won’t add unnecessary files

Now that your repository is created on github, navigate to your local project folder and right click “Git Bash Here”.

You can select HTTPS or SSH

Now that your repository is created on github, navigate to your local project folder and right click “Git Bash Here”.

This will automatically run git bash from the current directory

Within the git bash window, the first step is to initialize the folder with “git init”

Now that git is setup locally, it’s time to connect to your github repository with “git remote add origin” and paste the copied URL

If this is the first time, you’ll be prompted for your github credentials

You will want to remember to “pull” data from the github server with “git pull origin main” before making changes. This will also insure that your .gitignore file is saved locally.

“main” is the new default for the inital branch but you can name it anything you want

You now have any new files from the server but you aren’t tracking them yet. Type “git status” to view any untracked files.

All untracked files will be shown in red

To add all untracked files, type “git add .”

Almost there…you need to create a ‘snapshot’ or ‘save’ of your repository and you can do this with “git commit -m <title>”.

Add a relevant name for <title> adding the quotation marks if there are spaces in your name

Last order of business is pushing your git to the remote server. Just type “git push origin main” and voila.

Here you can see your files uploading

Congratulations, you have successfully created your first github repository and pushed any local changes to the server. Back on github your repository should show the new files that were merged.

--

--

No responses yet