Getting Started with Git

Sabrina Windsor
2 min readApr 28, 2021

--

My knowledge surrounding git and repositories before this point in time was practically nonexistent. There’s a lot that I will still be learning, but here’s how to get started:

  1. Make an account with Github and install Git. Googling “git” should provide the appropriate download whether you work on a mac, or pc.
  2. The download for Git seems rather complicated, but the defaults will good for starting out in a personal setting. So just keep clicking through the process until installation is complete.
  3. Search for git on your computer, and open “Gitbash”
  4. To navigate you can use various commands. Typing “ls” (l as in look)then hitting the enter key will make Git list all the files and directories associated with the current directory. To change directories, type “cd”, space, then start typing the chosen directory. I.e. “desktop” or “documents”, you can press tab after writing enough letters and Git will fill the rest in on its own.
  5. From there you can list the directories associated with this one by typing “ls”. Keep going until you navigate to the project you need to connect to Github.
  6. On Github, you’ll want to make a new repository, by clicking “create repository” on the main page once you’ve signed in.
  7. Name it, write a small description about it, then select if you want just anybody to be able to access this repository or not. After that you’ll want to limit Unity’s ability to collaborate certain files by clicking “Add .gitignore” and then typing “unity”.
  8. Create repository.
  9. To connect your project, on the repository on Github, click on the green “code” button, and copy the url.
  10. Once you navigate to the project on Gitbash (you can also right-click on the project file and select “open with Gitbash”), type “git init” then “enter” to initialize a repository within your project.
  11. Type “git remote add origin” then paste the url from Github to create a master server and connect it to the Github repository.
  12. To verify that it’s connected, you can type “git remote -v”
  13. To get a list of commands to use, type “git — help”

Now you’ve gotten the basics of getting Git up and running and connecting it to Github. I’ll be making another article that goes into what exactly Git and Github is, and all the common terminology that is used into navigating them.

This will probably make more sense as you learn more about commits and using Git, but always remember to pull, then commit, then push. This will keep your commits from conflicting with other’s.

--

--

Sabrina Windsor
Sabrina Windsor

Written by Sabrina Windsor

Currently learning to code with the help of GamedevHQ in order to someday my my game ideas come to life!

No responses yet