This course provides a comprehensive introduction to Git, from basic concepts to working with branches, using the command line, and leveraging Git with Visual Studio and Visual Studio Code.
Introduction to Git
Duration: 2 days
Does Git stand for global information tracker or goddamn idiotic truckload of sht* (according to Linus Torvalds)? Either way, it's the most widely used source code management tool today. This course provides you with an introduction to Git, from basic concepts to working with branches, using the command line, and leveraging Git with Visual Studio and Visual Studio Code.
Who Should Attend
- Developers and technical professionals who want to deepen their skills in Introduction to Git.
- Architects and team leads evaluating practical implementation patterns.
- Teams adopting modern engineering practices for delivery and operations.
Prerequisites
- Basic familiarity with command-line interfaces
- Experience with any programming language
- Understanding of basic software development concepts
Learning Goals
- Understand the core concepts and architecture behind the course topic
- Apply recommended implementation patterns in practical scenarios
- Build and validate solutions using modern tooling and workflows
- Troubleshoot common issues and improve reliability
- Plan next steps for production-ready adoption
Course Content
Introduction to Git
- Source code management comparison (centralized vs. distributed)
- Git's design philosophy and advantages
- Git command-line interface basics
- Git internals: objects, references, and the .git directory
- Understanding commits, trees, and blobs
Working with Repositories
- Cloning existing repositories
- Initializing new repositories
- Configuring Git (user identity, editor, aliases)
- Adding and removing files and directories
- The staging area (index) and its role
- Ignoring files with .gitignore
Tracking Changes
- The Git workflow: working directory, staging, repository
- Committing changes with meaningful messages
- Viewing and understanding diffs
- Amending commits
- Stashing work in progress
History and Repository State
- Searching the Git repository (git grep, git log filtering)
- Log analysis and visualization
- Viewing file history and annotations (git blame)
- Comparing commits, branches, and tags
Branches and Merges
- Understanding branches as lightweight pointers
- Creating and switching branches
- Merging branches (fast-forward vs. three-way merge)
- Resolving merge conflicts step-by-step
- Rebasing commits: when and why
- Interactive rebase for commit cleanup
- Cherry-picking specific commits
Git Worktrees
- Working on multiple branches without stashing or re-cloning
- Creating and listing worktrees with
git worktree addandgit worktree list - Typical use cases: hotfixes during feature work, parallel pull request reviews, and running tests on another branch
- Locking, moving, unlocking, and pruning worktrees with
git worktree lock,git worktree move,git worktree unlock, andgit worktree prune - Worktree constraints, including one checkout per branch
- Safely removing worktrees with
git worktree removeandgit worktree prune
Working in Teams
- Remote repositories: adding, fetching, pulling, pushing
- Centralized workflow, Feature branch workflow, Gitflow workflow
- Forking workflow (open-source collaboration model)
- Mono-repos vs. multi-repos
- Using submodules and subtrees
Fixing Things
- Undoing changes: reset vs. revert vs. restore
- Recovering lost commits with reflog
- Rewriting history: risks and best practices
Git with IDEs
- Using Git in Visual Studio
- Using Git in Visual Studio Code
- Integration with GitHub, Azure DevOps, GitLab
Git in the DevOps Pipeline
- Continuous Integration with Git hooks and automation
- Continuous Delivery and deployment triggers
- Deployment patterns and branching strategies
- Semantic versioning and tagging releases
- Tips, Tricks & Best Practices
- Writing effective commit messages
- Branch naming conventions
- When to rebase vs. merge
- Securing repositories and handling sensitive data
- Git aliases and productivity shortcuts
Hands-on Labs
- Initialize a repository, stage changes, and create meaningful commits
- Create feature branches and resolve a merge conflict
- Rebase a feature branch and clean up its history with interactive rebase
- Work on multiple branches at once using
git worktree - Recover from mistakes using reset, revert, and reflog
- Integrate Git operations into Visual Studio and Visual Studio Code
Outcomes
After completing this course, participants can apply the covered concepts and tooling to implement reliable solutions in real-world projects.