Home - ivomac/GitBasics GitHub Wiki
πͺ£ Git Concepts Explained Visually
- ποΈ Git's power comes with complexity that can be intimidating.
- βοΈ Many Git concepts are counter-intuitive or confusingly named:
- Cherry-pick? Detached HEAD??
- π We explore some elements of git from different perspectives to create a more solid picture.
- π₯Έ The objective is to understand git better, not to know all the internals.
- π§° We barely discuss terminal commands. We focus on what can be done and why.
- πΌ Streamlined for internet-age kids with no attention span!
β οΈ Usage
- π Previous experience with Git and programming is expected.
- π² This emoji indicates SourceTree-specific info.
π§± Content
πͺ£ Git Repository as a Graph
- πΈ Commits: Nodes in a graph
- π Branches: Simple pointers to commits
- π§ HEAD: The reference to the current commit
- π Index: The draft of the next commit
π Git Repository Folder
- π Staging: Preparing the next commit
- β
Committing: Creating new nodes in the commit graph
ποΈ Working Directory
- π Project Dir: File structure
- π« File States: Staged/Unstaged, tracked/untracked, ignored
π Checkout/Switching
- π Moving Around: Switch to/Checkout commits/branches
- π¦ Stashing: Temporarily storing uncommitted changes
- π³ Worktrees: Work on multiple branches in separate folders
π Diffs
- π§© Hunks: Segments of changes
- π Diffs: Comparing versions
- π Conflict Markers: The way Git shows several versions in a file
- π Commit Distance: Common measure to compare branches
π Merging
- π Merging: Combining work from different branches
- βοΈ Resolving Conflicts: Strategies and best practices
βοΈ Rebasing
- π Cherry-picking: Applying specific commits to different branches
- βοΈ Rebasing: Move an entire branch to a different base commit
- π§ Interactive Rebasing: Squashing, editing, and reordering commits
π Recovery Techniques
- πΈοΈ Reflog: A safety net for recovering lost commits
- βͺ Reset/Revert/Restore: Different ways to undo changes
π Remotes
- π Remotes: The repositories you want to sync with
- π Tracking: How local and remote branches relate
- π Syncing: Syncing with other repositories
- π₯ Merge/Pull Requests: Online collaboration feature
βοΈ Configuration
- π οΈ Git Config: User identity, line endings, default branch, rerere...
- πͺ Git Hooks: Automating tasks with pre-commit and post-commit hooks
πͺ Interfaces
- πΊ git: Git's main interface (the git CLI)
- π lazygit: Fully-featured and intuitive TUI
- π² SourceTree: Popular free cross-platform GUI