Understanding Git & Github Core Concepts

This blog will talk about the differences between Git and Github, remote and local, the importance of creating a branch, and best practices during the merging process.

Git vs Github

Git is a program on your computer that tracks changes made to a project, while Github is a website that lets you post your code and share it with others. This can be used as a backup, for collaborating, and for sharing.

Understanding Repositories

A repository contains project files and a full history of the work. There's generally one per project, it has to be created, and it exists both locally and remotely.

The remote repository is held by Github and the local repository is on the machine being used. The remote repository acts as a back-up in case of local computer issues. While, the local repository gives users room to experiment and lessens the odds of breaking or undoing the work of other developers as it won't reflect in the main environment if it's not pushed.

Importance of Branches

A branch creates a space separate from the main code, allowing changes to be made in isolation before merging. This is beneficial for working simultaneously, allows for a review before the merge, and overall keeps the main code safe during the process.

To create a branch, a command similar to: git switch -c branch-name would be used, where switch is switching from main, "-c" is creating the branch, and "branch-name" is whatever the branch is being named.

With this, an important best practice is to pull first, where you want to ensure the branch you're working on is up-to-date with the main code. This will lower the likelihood of issues occurring while merging.

Other Best Practices

Another best practices is having small commits, meaning one logical change per the commit with a message about why. This will allow you to identify the reason for breaking if a break occurs, and allow others to understand your work.

Lastly, remember to keep your passwords, tokens, and keys hidden using .gitignore.

Good luck on your Git journey!

Author:
Skyla Patterson
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2026 The Information Lab