This site uses cookies. Not nice tasty oven fresh cookies, with gooey chocolate, or with raisins and oatmeal if you want to pretend to be healthy. But little snippets of code to improve your experience. If you continue, it is assumed you're happy to receive all cookies from the website.
More about cookies

Git and GitHub

Free and open source revision control software and web based hosting service for hosting git development projects.

30 January 2019

Current web development practices place an emphasis on both continous improval, whether it be via agile or waterdown methodologies during development, or even just maintaining a live site, and working as part of a development team. Both these scanrios demand that content be archived and available for sharing.

Git is by far the most popular solution for source code management, with GiTHub acting as a sharing platform enabling developers to track code changes and to share with other developers code and code improvements.

Git

Git was developed in 2005 by Linus Torvalds for the development of the Linux kernal in response to the lack of availability of a free and open source source code management system for the Linux community. The importance of free and open source to the Linux community is probably the single most important reason for its popularity.

Like most other (propriatory or open source) distributed version control systems Git makes use of repositories in the various directories that hold a complete history and full version tracking abilities. This is all stored in the directory meaning no network / internet connection is required.

Sharing of directories and repositories can be achieved via different platforms such as GitHub, but more on that later.

What's in a name?

Linus Torvald has never fully explained the name choice for Git. He has quipped that he named it after his own personality, but other resaons are that it is a mispronounciation of "get", or that it means to be simple, and that it could stand for Global Information Tracker.

I name all my projects after myself. First 'Linux', now 'git'.

Linus Torvald - git.wiki.kernel.org

BitKeeper

Git development began in April 2005, after many developers of the Linux kernel gave up access to BitKeeper, a proprietary source control management (SCM) system that they had formerly used to maintain the project. The copyright holder of BitKeeper, had withdrawn free use of the product.

Linus Torvalds wanted a distributed system that he could use like BitKeeper, but none of the available free systems met his needs. Torvalds cited an example of a source-control management system needing 30 seconds to apply a patch and update all associated metadata, and noted that this would not scale to the needs of Linux kernel development, where synchronizing with fellow maintainers could require 250 such actions at once.

Torvalds set out the following criteria:

  • Patching should take no more than three seconds,
  • Take Concurrent Versions System (CVS) as an example of what not to do; if in doubt, make the exact opposite decision,
  • Support a distributed, BitKeeper-like workflow,
  • Include very strong safeguards against corruption, either accidental or malicious.

These criteria eliminated every then-extant version control system, so immediately after the 2.6.12-rc2 Linux kernel development release, Torvalds set out to write his own.

How does it work?

The major difference between Git and any other version control system is the way Git thinks about its data. Conceptually, most other systems store information as a list of file-based changes. These other systems think of the information they store as a set of files and the changes made to each file over time

Git thinks of its data more like a series of snapshots of a miniature filesystem. With Git, every time you commit, or save the state of your project, Git basically takes a picture of what all your files look like at that moment and stores a reference to that snapshot. To be efficient, if files have not changed, Git doesn't store the file again, just a link to the previous identical file it has already stored.

Git has three main states that files can reside in: committed, modified, and staged:

  • Committed means that the data is safely stored in your local database.
  • Modified means that you have changed the file but have not committed it to your database yet.
  • Staged means that you have marked a modified file in its current version to go into your next commit snapshot.

Git makes use of branches. A branch represents an independent line of development. Branches serve as an abstraction for the edit/stage/commit process. they can be thought of as a way to request a brand new working directory, staging area, and project history. New commits are recorded in the history for the current branch, which results in a fork in the history of the project. Like a tree branch, or a train branch, a branch is basically a development route, allowing multiple developments that will not interfere with one another.

GitHub

GitHub is a web-based hosting service for version control using Git. It is mostly used for computer code. It offers all of the distributed version control and source code management (SCM) functionality of Git as well as adding its own features. It provides access control and several collaboration features such as bug tracking, feature requests, task management, and wikis for every project.

GitHub offers plans for both private repositories and free accounts which are commonly used to host open-source software projects. As of June 2018, GitHub reports having over 28 million users and 57 million repositories (including 28 million public repositories), making it the largest host of source code in the world.

Surfer Dude Studios own GitHub can be found by following this link.