The Magic of Version Control with Git and Github — Part I

Andrea Zilio
3 min readMar 30, 2021

Were there ever moments you wished you could go back to an earlier stage of your life? Well in software development you can.

Version control is the magic that allows you to track changes and when needed, simply revert back to a previous version. It also simplifies collaboration between several developers, as multiple developers can make changes which then are merged into one source code.

Git is one of the most widely used open source version control solutions. Combined with a remote online repository such as Github or Bitbucket it can make your live as a developer much easier.

Let’s see how we can get started with Git and Github.

1. Install Git

Git Logo by Jason Long

Git is a software that needs to be installed locally on your computer. You can download it here: https://git-scm.com/

Once installed you have the choice of using a command line or graphical interface. It is generally recommend to use the command line. If you rather use a GUI, Git has a basic one and there are also more advanced solutions like Sourcetree which comes from Atlassian, the company that owns Bitbucket. For now lets look at the standard Git Bash command line interface.

To quickly launch Git in the correct folder you can navigate to the folder, right click and then select Git Bash. You will then see the new console window.

With ls you can see the files inside this folder.

With git init you will create your local repository. As you can see there is now a new folder .git.

Demo: How to use git bash and create a local repository.
Demo: How to use git bash and create a local repository.

2. Get started on Github

We will be using GitHub here. There are other online repositories such as Bitbucket, which work in a similar way.

Go to https://github.com/ and create your account.

Other than the regular username and password, Github also offers an addtional two-factor authentication (2fa) which you might want to consider. You can find a detailed instruction once you set your account up under Settings -> Security.

To create a new repository you can choose “new” on the left side of the screen or select the “+” on the right top corner.

Give your new repository a name and if you like a description. Then you can select whether it will be public or private. A readme file can be used to provide more information, especially if your repository will be public. A gitignore file tells git to ignore certain files. As we will see with Unity this can be helpful. For our simple HTML project however it is not required. For a public repository you might also want to select a license model.

Create a repository on GitHub

3. Ready to go…

We are now ready to work with Git and GitHub. The next post will explain the most common commands. You can find it here: https://andreazilio.medium.com/the-magic-of-version-control-part-ii-frequent-git-commands-8b06f742a34d.

--

--

Andrea Zilio

Passionate Game Developer and Learning Expert. I love to create games and interactive experiences using Unity, Articulate, C#, JavaScript, PHP, HTML, CSS.