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):||26 September 2013|
|PDF File Size:||5.17 Mb|
|ePub File Size:||4.69 Mb|
|Price:||Free* [*Free Regsitration Required]|
This leads us to the three main sections of a Git project: 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.
1.3 Getting Started – Git Basics
You modify files in your working tree. 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.
This makes Git more like a mini filesystem with some incredibly powerful tools built on top of it, rather than simply a VCS.
Modified means that you have changed the file but have not committed it to your database yet. Git is a member of Software Freedom Conservancy, which handles legal and financial needs for the project. Git and Other Systems 9.
Pro Git, Second Edition
You do a commit, which takes the files as they are in the staging area and stores that snapshot permanently to your Git directory. With Git, every time you commit, or save the state of your project, Git basically takes a picture blok what all your files look like at that moment and stores a reference to that snapshot.
If it has been modified and was added to the staging area, it is staged. A SHA-1 hash looks something like this: When you do actions in Git, nearly all of them only add data to the Git database. The major difference between Git and any other VCS Subversion and friends bopk is the way Git thinks about its data.
And if it was changed since it was checked out but has not been staged, it is bookk. Because you have the entire history of the project right there on your local disk, most operations seem almost instantaneous. Git in Other Environments A1. Instead, Git thinks of its data more like a series of snapshots of a miniature filesystem. Consider becoming a supporter! So, what is Git in a nutshell? A SHA-1 hash looks something like this:. Git thinks about its data more like a stream of snapshots.
Embedding Git in your Applications A2. Everything in Git is checksummed before it is stored and is then referred to by that checksum. The Git directory is where Git stores the metadata and object database for your project. This is the most important part of Git, and it is what is copied when you clone a repository from another computer. For a more in-depth look at how Git fitpro its data and how you can recover data that seems lost, see Undoing Things.
This is an important distinction between Git and nearly all other VCSs. You will see these hash values all over the place in Git because it uses them so much. The titpro that Git uses for this checksumming is called a SHA-1 hash. 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 Boook is and the fundamentals of how it works, then using Git effectively will probably be much easier for you.
Conceptually, most other systems store information as a list of file-based changes. Git Has Integrity Everything in Git is checksummed before it is stored and is then referred to by that checksum. In fact, Git stores everything in its database not by file name but by the hash value of its contents.