GitHub & Version Control

What is it?

At its core, GitHub is a website and cloud-based service helping developers store and modify their code whilst changes are tracked and stored like a special type of database. This way, if anything goes wrong or a bug arises, developers can role back to previous versions and adjust their code from there. This is called version control, helping developers track and manage changes on the code of a project. The ‘Git’ in GitHub represents a specific open-source version control system, it is also distributed, meaning that a codebase or project is available on each developer’s computer providing the ability for easy branching, typically through the command line interface.

 

Version Control

Essentially, version control helps a developer, or a team of developers, track changes and manage those changes. If it is a large project for example, you can imagine the complexity of the codebase and without version control, you would have a one absolute base without the ability to roll back to previous changes easily. A good example of this is WordPress, an open-source software used to make websites, blogs and apps. If a developer needed to make a change to a component within WordPress, it would be a risky task if directly modifying the source code, so instead, version control allows branching and merging.

Branching is the process of duplicating the source code, that exists within a repository, where the developer can then make changes to the specific code base necessary. Once any changes have been made, the developer can then merge the code into the main source code, making it ‘official.’ Obviously, all these changes are now tracked and can be reverted if it was ever needed.

 

GitHub

Now version control and Git has been explained, it is good to understand how the interface of GitHub works and how to use its version control abilities. Take a look below to see how it works;

  • Repository
    A repository or ‘repo,’ is the base location where all the files for a project are stored, it can have folders and any type of files (HTML, CSS, JS, Images and more).

 

  • Forking a Repo
    ‘Forking’ is the process of creating a new project based on another project that already exists. For example, if you see a project you like and want to make changes to do, you can fork that repository, make any necessary changes you need to and release that project as a new repo. Any changes made to the original repo, such as updates, can then be added to your current fork if needed.

 

  • Pull Request
    After forking a repository and making changes to it, a developer can then pursue a Pull Request for those changes to be included with the initial and official repository of that project, allowing you to be recognised by the original developers. GitHub provides a medium for you and the main projects developers to communicate and decide whether or not it should be included officially.

 

  • Branch
    A branch allows for a developer to work with different versions of a repo at the same time, where you can a default master branch (production) and every branch after that is a copy of the master branch. Creating new branches allows for bugs to be fixed and once it is ready, can be merged back into the master branch.

 

  • Commits
    Any changes made to files in a repository are called commits, which are tracked and allow for a developer to explain what they have done with this code change.

 

The good thing about GitHub is that it is relatively user friendly for people who don’t have much programming or command line knowledge. Its interface is so easy, that it’s even used to store personal projects that aren’t code based, such as books. However, if you’re a developer or have a team of developers working on a project, GitHub makes it easy to track the progress and mitigate any problems that could arise throughout development.

Another major advantage of GitHub is that it can integrate with many common platforms, like Amazon and Google Cloud – allowing for a team of developers within an organisation to work with many different programming languages and platforms.

Read More
Avatar for Matthew Matthew 25th October 2019 0 Comments

UI vs UX – The Difference

People often confuse User Interface (UI) and User Experience (UX) and usually use the terms interchangeably. Ultimately, both are equally important and work hand in hand with each other, but it helps to know the difference.

Read More
Avatar for Matthew Matthew 22nd May 2019 0 Comments

Our Top Ten Tips For Google Ads Campaigns

Google Ads can be quite a confusing platform to use if you haven’t used it before. Here are our top ten tips for managing your Google Ads Campaigns.

Read More
Avatar for Matthew Matthew 17th May 2019 0 Comments

The Benefits of Using WordPress

We love WordPress here at Square Media, so here are the top benefits of using wordpress as your Content Management System.

Read More
Avatar for Matthew Matthew 15th May 2019 0 Comments

10 Essential WordPress Plugins for Online Businesses

There are so many Wordpress plugins out there, it can get a bit confusing. Here are our top 10 Wordpress plugins for online businesses.

Read More
Avatar for administrator administrator 19th February 2019 0 Comments

How to Start Your Own Blog in 5 Simple Steps

So, you’re thinking of starting a blog… but have absolutely no idea where to start? Well, here is our 5-step guide to starting your own blog from scratch… STEP 1: Pick a domain for your blog A domain is your own unique URL, that people will use to find your blog, for example, yournewblogsetup.com. The [...]

Read More
Avatar for administrator administrator 25th January 2019 0 Comments

Want to up Your Social Media Game? Here’s our 7 Top Tips…

Social media is one of the best ways for a business to interact with its customers and potential customers. However, many business owners just don’t know how to effectively use social media for their business. If you’re struggling to make an impact on social media, then try the following tips… 1. Choose the Right Platforms [...]

Read More
Avatar for administrator administrator 21st January 2019 0 Comments

Top Tips and Tools to Help You Write a Press Release

A press release is simply a brief, compelling news story that is used to distribute information to the press, and ultimately the public. Press releases are an essential tool for getting the word out, and they are fairly inexpensive, too! Here we provide our top tips for writing an effective press release along with some [...]

Read More
Avatar for administrator administrator 15th January 2019 0 Comments

Our Top Website Design Tips

The design of your website can make all the difference, it really can be the deciding factor for a potential customer. No matter what size your business, big or small, it requires a professional looking website. However, we understand that when you're just starting out the world of web design can be quite intimidating. Here [...]

Read More
Avatar for administrator administrator 10th January 2019 0 Comments

Black Hat SEO Techniques to Avoid Like the Plague

Black hat SEO refers to the use of a number of sneaky SEO practices to increase a websites’ ranking position by violating search engines’ guidelines. Using proper techniques, preferred by search engines to rank and receive traffic organically can be time consuming and make black hat techniques look attractive. However, search engines will penalise sites [...]

Read More
Avatar for administrator administrator 8th January 2019 0 Comments