1and1 Help Centre Categories

print article

What is Git?

For Linux packages with SSH access

Git is a distributed version control and source code management system. Git allows you to keep track of file changes - both if you are working on your own or within a team - and restore older versions if necessary. Git allows several users to work on the same code simultaneously without overwriting each other's changes.

Furthermore, Git allows you to create several branches. These branches can be used for testing new plugins and website structures or for developing different PHP scripts independently from one another. The default branch in Git is the master branch. This points to the last commit. New branches are always created on the basis of the master branches.

Git projects consist of three main sections:
  • The Git directory is the most important part of Git. It contains the metadata and object database.
  • The working directory is a local checkout of a specific version where you can change you files.
  • The staging area is a simple file that stores information about the changes going into the next commit.
Reasons for using Git

If you are a web developer or are interested in developing and maintaining your own website, either on your own or as part of a team, you can definitely take advantage of Git. Main use cases are the following:

  • Change tracking makes it possible to compare different versions and also to recover old versions.
  • Creating one (or several) separate branch(es) for development while maintaining a master branch containing the released code versions.
  • Recovering files before they are committed into the repository.
  • Breaking up the work changes by splitting them into smaller, self-contained pieces. This can be useful when you are fixing a bug while implementing a new feature.
  • Merging two or more versions of the same source code.
For additional information, you may want to reference: