GIT is a distributed version control system that allows every developer working on a project have their own working copy with the full history of all changes instead of keeping the project history in one single place.
As with many great things in life, Git began with a bit of creative destruction and fiery controversy.
The Linux kernel is an open source software project of fairly large scope. For most of the lifetime of the Linux kernel maintenance (1991–2002), changes to the software were passed around as patches and archived files. In 2002, the Linux kernel project began using a proprietary DVCS called BitKeeper.
In 2005, the relationship between the community that developed the Linux kernel and the commercial company that developed BitKeeper broke down, and the tool’s free-of-charge status was revoked. This prompted the Linux development community (and in particular Linus Torvalds, the creator of Linux) to develop their own tool based on some of the lessons they learned while using BitKeeper. Some of the goals of the new system were as follows:
Since its birth in 2005, Git has evolved and matured to be easy to use and yet retain these initial qualities. It’s incredibly fast, it’s very efficient with large projects, and it has an incredible branching system for non-linear development.
|
GIT is a version control system that treats data like a stream of snapshots: Every time you commit, GIT takes a picture of what all your files look like at that moment and stores a reference to that snapshot. |
|
Most operations in Git only need local files and resources to operate. In fact, you can go without a remote repository at all. |
|
All the changes made in files or folders are known to GIT. You cannot lose information in transit or get a corrupted file with GIT failing to detect it. |
|
Nearly any action in GIT actually adds data to the Git database: When you commit changes to a file, GIT doesn't replace the 1st version of the file with the 2nd one; it doesn't store both versions of the file either - it "writes down" how the initial file was changed, when, and by whom. |
Like any other system, GIT has its positive and negative sides.
|
|
|
|
|
+ |
The algorithms implemented inside Git are optimized for quick and effective committing, branching, merging, and comparing versions. |
|
- |
GIT can be difficult to learn. |
+ |
GIT focuses not on the file name but on the content of the file itself. |
|
- |
With GIT, you do not necessarily need a central, "official" repository. |
+ |
File content as well as the true relationships between files, folders, directories, versions, tags, and commit are secured with a cryptographically secure hashing algorithm SHA1. |
|
|
|
+ |
GIT supports various kinds of nonlinear development workflows. |
|
|
|
+ |
With GIT, operations that affect branches and tags are also stored as part of the change history. |
|
|
|
With GIT, your files can be in one of three states:
Besides, your files can also be pushed to the remote repository (if you have one).
This means that there are 4 main sections of your GIT project - 3 in your local repository and 1 in your remote repository.
There is also the 5th section in your project - stash area - though we shall not speak about it yet. You can read about stash and stashing here and here.
Definite actions you perform when working on your project depend on your production work flow and development needs.
However, they can still generalized in the form of a simple diagram (given below).
The number of possible workflows is big, so it might be very difficult to choose the correct one when implementing GIT in your team.
However, there are some common ones that can be taken as a starting point:
Here you can read about these four common workflows (includes details and examples).
Peter Cottle (formerly, of University of California, Berkeley) has created an interactive online tutorial about GIT branching - it is here:
In this tutorial, you can play with some simple branches, experiment with training commits, test merging and rebasing, etc. The tutorial is very useful for GIT beginners though it uses GIT commands and not IDE.
Lycia supports the full-scale GIT functionality and provides modern and user-friendly tools for working with GIT repositories.
Below you can find the links to pages of this documentation where you can read about how GIT functionality is realized in LyciaStudio.
GIT basic terminology
GIT configuration
Branching
Working with local repositories
Importing projects from a local repository to a workspace
Merging
Rebasing
Stashing
What is a conflict and how to solve them?
GIT status: How to learn all about the current state of your repositories
See the difference: Checkout, reset, and revert
Working with remote repositories
Creating remote repositories (on the example of gitlab.com)
Fetching from a remote repository
Pulling from a remote repository
Pushing to a remote repository
Synchronizing with remote repositories
GIT Reflog view
GIT Tree Compare view
Rebase Interactive view