-
Notifications
You must be signed in to change notification settings - Fork 1
Chapter_1
Chris McIntosh edited this page Nov 20, 2019
·
4 revisions
- Version control systems save the history of changes to a file
- Doesn't have to be Source Code
- Distributed Version Control systems like Git fully mirror the entire repo in clients
- Developed by Linus Torvalds
- Developed to be fully distributed and non-linear from start
- Git stores data as snapshots of a mini file system
- Most other (D)VCS's think of data as files with patches
- Git operations are local unless explicitly targetting the server
- Data is checksummed with SHA-1 and that checksum is used to determine if there are changes
- As a general rule git is only additive, it rarely will remove data
- Git files are in one of 3 states:
- Modified
- Changed but not committed to the database
- Staged
- Marked the current state of the file to go in to a commit
- Committed
- All marked changes have been saved to the local database
- Modified
- Working Tree
- A single checkout of a version of the project
- Decompressed to your file system on request
- Staging area
- Technical name is Index
- A file in the .git repo that contains info on what is going into the next commit
- Git directory
- Contains metadata and the object database
- The only thing that is copied when doing a clone
- TL;DR Understand the command line
brew install git
- Skipping the rest...
- Git can be configured with the
git config
tool or written to the config files - Config files are hierarchical, taking the "closest" relevent config
/etc/gitconfig
~/.gitconfig
- .
git/config
-
git config --list --show-origin
- View all settings and which file they were derived from
- Important things to set
- user.name
- user.email
- core.editor
- Three ways to get help
git help <verb>
git <verb> --help
man git-<verb>
-
git <verb> -h
- short concise help text
- Useful commands from this chapter
git config --global <config.option> <value>
git help <verb>
git <verb> --help
man git-<verb>
git <verb> -h
- Working tree is a single instance of a version checked out locally
- Staging area is called the index and is a file in the .git repo with info about the next commit
-
.git
directory contains metadata and the object database - Three states are:
- Modified
- Staged
- Committed
- Configure User name, email, and editor on a new install at minimum