So, what is Git in a nutshell? This is an important section to absorb, because if you understand what Git is and the fundamentals of how it works, then using Git. The second edition of this book is meant to address those example of Git hosting, I have decided to turn that part of the book into more. Access this book for free. ISBN ; This book is an open access book, you can download it for free on Softcover 44,95 €.
|Published (Last):||11 May 2006|
|PDF File Size:||6.71 Mb|
|ePub File Size:||7.76 Mb|
|Price:||Free* [*Free Regsitration Required]|
You do a commit, which takes the files as they are in the staging area and stores that snapshot permanently to your Gitprk directory. When you do actions in Git, nearly all of them only add data to the Git database. Git on the Server 4. So, what is Git in a nutshell? In fact, Git stores everything in its database not by file name but by the hash value of its contents.
Git – Git Basics
These other systems CVS, Subversion, Perforce, Bazaar, and so on think of the information they store as a set of files and the changes made to each file over time this is commonly described as delta-based version control.
The staging area is a file, generally contained in your Git directory, that stores information about what will go into your next commit. You selectively stage just those changes you want to be part of your next commit, which adds only those changes to the staging area.
Git has three main states that your files can reside in: Instead, Git thinks of its data more like a series of snapshots of a miniature filesystem. Git Has Integrity Everything in Git is checksummed before it is stored and is then referred to by that checksum.
The major difference between Git and any other VCS Subversion and friends included is the way Git thinks about its data. This is a character string composed of hexadecimal characters 0—9 and a—f and calculated based on the contents of a file or directory structure in Git.
Conceptually, most other systems store information as a list of file-based changes. Git thinks about its data more like a stream of snapshots. It makes Git reconsider almost every aspect of version control that most other systems copied from the previous generation. This is the most important part of Git, and it is what is copied when you clone a repository from another computer. If you get on an airplane or a train and want to do a little work, you can commit happily to your local copy, remember?
This is an important section to absorb, because if you understand what Git is and the fundamentals of how it gipro, then using Git effectively will probably be much easier for you.
Conservancy is currently raising funds to continue their mission. And if it was changed since it was checked out but has not been staged, it boik modified. Committed means that the data is safely stored in your local database.
It is hard to get hook system to do anything that is not undoable or to make it erase data in any way. You will see these hash values all over the boik in Git because it uses them so much. In many other systems, doing so is either impossible or painful.
This leads us to the three main sections of a Git project: Git in Other Environments A1. If it has been modified and was added to the staging area, it is staged.
1.3 Getting Started – Git Basics
This makes using Git a joy because we know we can experiment without the danger of severely screwing things up. These files are pulled out of the compressed database in the Git directory and placed on disk for you to use or modify. This may not seem like a huge deal, but you may be surprised what a big difference it can make. Git and Other Systems 9. Git is a member of Software Freedom Conservancy, which handles legal and financial needs for the project.
A SHA-1 hash looks something like this:. Modified means that you have changed the file but have not committed it to your database yet. A SHA-1 hash looks something like this: