Git Version Control

Git Version Control
Git Tools
Revision Selection
Single Revisions
Short SHA-1
Ancestry References
Notes : Escaping the caret on Windows
Commit Ranges
Double Dot
Triple Dot
Interactive Staging
Staging and Unstaging Files
Staging Patches
Stashing and Cleaning
Add stash
List stash
Apply stash
Remove stash
Pop stash
Include untracked
Cleaning your Working Directory
Signing Your Work
Signing Tags
Verifying Tags
Signing Commits
Searching
Git Grep
Git Log Searching
Rewriting History
Changing the Last Commit
Reordering Commits
Splitting a Commit
Squashing Commits
The Nuclear Option: filter-branch
Removing a File from Every Commit
Advanced Merging
Aborting a Merge
Ignoring Whitespace
Manual File Re-merging
Submodules
Starting with Submodules
Cloning a Project with Submodules
Working on a Project with Submodules
Pulling in Upstream Changes
Contributing to a Project
Forking Projects
The GitHub Flow
Creating a Pull Request
Pull Requests on Pull Requests
Special Files
README
CONTRIBUTING
Scripting GitHub
Services
Hooks
Distributed Git
Distributed Workflows
Centralized Workflow
Integration-Manager Workflow
Dictator and Lieutenants Workflow
Commit Guidelines
Preparing a Release
The Shortlog
Generating a Build Number
Git Branching
Switching Branches
Clean state
Show graphs in console
Basic Merging
Basic Merge Conflicts
Conflict-resolution markers
Resolve
Mergetool
Branch Management
* character
Last commit of each branch
Merged and No-Merge Options
Branching Workflows
Long-Running Branches
Topic Branches
Remote Branches
Don't type your password every time
Remote tracking branches
Synchronize
Pushing
Pushing with different name
Tracking Branches
Change upstream branches
See what tracking branches you have set up
Update info from all remotes
Pulling
Deleting Remote Branches
Rebasing
Example:
Rebasing the change introduced in C4
onto C3
After
Gits basic
The mechanism that Git uses for this
checksumming is called a SHA-1 hash.
The Three States
Committed means that the data is
safely stored in your local database.
Modified means that you have changed the
file but have not committed it to your
database yet.
Staged means that you have marked a
modified file in its current version to go
into your next commit snapshots.
Git config
Config default text editor
Git Identity
Checking your settings
Getting a Git Repository
Initializing a repository in an existing
directory
Cloning an Existing Repository
Recording Changes to the Repository
Checking the Status of Your Files
Short Status
Tracking New Files
Staging Modified Files
Ignoring Files
Viewing Your Staged and Unstaged
Changes
Git Diff in an external tool
Committing your changes
Removing Files
Moving Files
Viewing the Commit History
Useful options for git log
Undoing things
Unstaging a Staged File
Git reset can be a dangerous command!
Unmodifying a Modified File
It’s important to understand that git checkout -<file>
is a dangerous command!
Working with Remotes
Showing Your Remotes
Adding Remote Repositories
Fetch all
Fetching and Pulling from Your Remotes
Pushing to Your Remotes
Inspecting a Remote
Renaming and Removing Remotes
Tagging
Listing Your Tags
Creating Tags
Annotated Tags
Lightweight Tags
Tagging Later
Sharing Tags
Checking out Tags
Git Aliases
Version Control System (VCS)
Version control is a system that records
changes to a file or set of files over time so
that you can recall specific versions later.
Centralized Version Control Systems : (such
as Git, Mercurial, Bazaar or Darcs)
The major difference between Git and any
other VCS (Subversion and friends
included) is the way Gitthinks about its
data.
9