What is Git?

Created 2021-02-17T23:58:08.1417611+00:00
Last updated 2021-07-01T20:29:59.1354486+00:00

Git is a version control system that has become very popular over the years and works with any project size.  For hosting, there are many Software as a Service (SaaS) options available or you can create your own Git server.  Once you have a Git server, you can install Git on a client machine and begin using it.  Git is command based but there are multiple GUI clients available.  For files or directories, you would like Git to ignore, you can create a “.gitignore” file and add a directory or file pattern.  While using Git it is best to branch early and often as Git provides efficient branching and it allows for a team to work in parallel without effecting the main branch.

Server Hosting

There are many different hosting services that provide Git as Software as a Service (SaaS) and they include GitHub, GitLab, BitBucket, Azure DevOps, etc.  Each will have their own pricing tiers that can start from a free tier with limited features to a more costly enterprise tier that allow access to all feature.  The benefit of using a hosting service is that they will take care of the underlying work to host Git.

It is possible to host Git on your own server leveraging any major operating system.  Of course, this will be more complicated then going through a hosting service.  You will need to consider security in who can access the server, redundancy to make sure your versioned content is protected from disasters, performance and memory usage as more versioned content is added to the server, etc.  Instructions on how to setup a Git server can be found on the internet.

Overall, when choosing an option for hosting, you should think about what the end solution is going to look like.  Is Git going to be where all intellectual property is versioned?  Will the versioned content be changed a lot?  Does this mean that the company will heavily integrate with Git requiring single sign on?  Should this be as secure as possible?  What about redundancy and disaster recovery?  There are a lot of things to think about and it helps with the more people you can get involved.

Client Installation

In order to use Git from a client computer you will need to download the Git installer for the corresponding operating system of the client computer then install it.  Git is primarily developed on Linux and contains Unix style commands making the use of Git in Linux and macOS easier as both have Unix style command line applications built in.  Git also supports the Windows operating system and provides an option to install Git Bash to provide a Unix style command line application.  Another option provided during installation is to include the Git GUI which makes using Git more user friendly.

Commands

There are many different commands provided by Git and I’m only going to go over a few of the most pertinent commands.  You can find out more about commands at https://git-scm.com/docs.

GUI Clients

Knowing and using commands is great but it is a good idea to find a GUI client to use as it can increase your and your team’s productivity.  The Git installer comes with the option to add the Git GUI but if it is not to your liking there are many third-party applications that you can investigate.  Some of these third-party include SourceTree, GitHub Desktop, TortoiseGit, Git Extensions, etc.  Depending on your project you might be required to use an application such as Visual Studio, Eclipse, etc. that could have Git integrated or available as a plugin.

Git Ignore

Certain projects will generate files or directories that you will not want to be included in the repository.  Git solves this problem by allowing the creation of a file called “.gitignore”, a file without a name but with an extension of gitignore, where you can include the file names and directories that you would like ignored.

Branching

One of the stand out features of Git is its branching model.  A main branch is created when a repository is created, from there a user can use the main branch directly.  Context switching between branches in Git is fast and efficient and it is encouraged to use branches often.  Branches can be easily created and deleted as well as work in isolation allowing for experimentation and to safely work without effecting a main branch.  Branches can exist for as long as storage space on the server permits, when you are completed with work on a branch you can merge that branch into another branch.  There are many branch workflows and release workflows that one can come up with, some of these include centralized, long-running branches, topic branches, environment/server branches and really anything you can think of.

Thank you for reading some basic information about Git. If you would like to learn more feel free to check out https://git-scm.com/