Skip to content

About

๐Ÿš€ Introduction course on Git for beginners and advanced

Resources

Stars

3 stars

Watchers

1 watching

Forks

Latest commit

ย 

History

91 Commits

Folders and files

Repository files navigation


Logo

A brief debunk of Git

Master Git and use it like a pro in your projects

๐Ÿ“– Read the interactive book ยป

Report Bug ยท Request Feature

About this repository

In professional development and large team projects, version control is a must. While Git is a powerful tool that enhances collaboration and productivity, its many features can sometimes feel overwhelming.

This guide is your go-to introduction to Git, covering both beginner and advanced commands. ๐Ÿ’ก Our goal is to help you feel confident when initializing a repo, managing updates, and resolving conflicts proving that Git isnโ€™t as intimidating as it seems.

๐Ÿ“– You'll find a comprehensive cheat sheet with clear examples and illustrations to help you master Git with ease.

How to read this course

๐Ÿ“– Read it online

The course is an interactive, animated book. The easiest way to read it is in your browser:

๐Ÿ› ๏ธ Run it locally

npm install
npm run dev

The book is built with Astro Starlight and served at http://localhost:4321/git-primer/.

๐Ÿš€ Deploy

Every push to main builds the book and deploys it to GitHub Pages automatically via the deploy-book.yml workflow.

(back to top)

Content

  1. Introduction to Git
    • What is Git? Why use it?
    • Difference between Git and GitHub
    • Installing Git (Windows, macOS, Linux)
    • Basic Git configuration (git config)
  2. Setting Up a Git Repository
    • Initializing a repository (git init)
    • Cloning a repository (git clone)
    • Understanding the .git folder
  3. Basic Git Workflow
    • Checking repository status (git status)
    • Staging changes (git add)
    • Committing changes (git commit)
    • Viewing commit history (git log)
  4. Working with Branches
    • What are branches? Why use them?
    • Creating and switching branches (git branch, git checkout, git switch)
    • Merging branches (git merge)
    • Resolving merge conflicts
  5. Remote Repositories
    • Connecting to a remote (git remote add)
    • Pushing changes (git push)
    • Fetching changes (git fetch)
    • Pulling updates (git pull)
    • Forking and contributing to open-source projects
  6. Undoing Changes & Resetting History
    • Discarding local changes (git restore, git checkout)
    • Unstaging files (git reset HEAD)
    • Amending commits (git commit --amend)
    • Reverting commits (git revert)
    • Reset vs. Revert vs. Checkout
  7. Understanding Git Internals
    • The Git object model (blobs, trees, commits)
    • How Git stores changes (snapshots vs. diffs)
    • Git references (HEAD, refs, tags)
  8. Advanced Git Commands
    • Interactive rebasing (git rebase -i)
    • Reflog and recovering lost commits (git reflog)
    • Cherry-picking commits (git cherry-pick)
    • Stashing work (git stash)
  9. Git Hooks & Automation
    • Pre-commit hooks (.git/hooks/pre-commit)
    • Post-commit and other hooks
    • Automating workflows with Git
  10. Git Best Practices
    • Writing good commit messages
    • Keeping a clean commit history
    • Git workflows (Git Flow, Trunk-based, GitHub Flow)
  11. Troubleshooting & Debugging Git Issues
    • Fixing detached HEAD state
    • Dealing with merge conflicts
    • Resolving git push and git pull errors
    • Diagnosing issues with git fsck and git gc
  12. Working with Submodules & Large Repositories
    • Using submodules (git submodule)
    • Handling large files with Git LFS
    • Optimizing repository performance
  13. Using Git with Other Tools
    • GitHub/GitLab/Bitbucket basics
    • Integrating Git with CI/CD
    • Using Git in VS Code and other IDEs
  14. Real-World Git Scenarios
    • Collaborating in a team
    • Handling hotfixes and release branches
    • Recovering from mistakes
  15. Learning resources
    • Practice sandboxes, exercises, and talks

(back to top)

License

This repository and all its content is under GNU General Public License v3.0.

(back to top)

About

๐Ÿš€ Introduction course on Git for beginners and advanced

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages