~/
hackweb.dev
What is Git?
Quiz
⌘K
...
~/
/tutorials
/git/git-what-is-git/edit
~ Contribute
Suggest a correction or improvement. The author reviews it before it goes live.
Loading...
Comment
0 / 300
Typo
Grammar
Broken link
Clarify
Code
en/tutorials/git/1git-what-is-git
Write
Preview
Diff
# What is Git? Git is a distributed version control system that tracks changes in files over time. It allows multiple people to collaborate on projects without overwriting each other's work. ## Why Version Control Matters Version control helps you: - Track every change made to your code - Revert to previous states if something breaks - Collaborate with others without conflicts - Maintain a complete history of your project ## Centralized vs Distributed Unlike centralized systems (like SVN) where there's one main server, Git gives every developer a full copy of the repository. This means: - Work offline without issues - Faster operations (no network needed) - Built-in backup on every clone ## What is a Repository? A repository (or "repo") is a directory that Git tracks. It contains: - Your project files - A `.git/` folder with all tracking data ```bash git --version # git version 2.42.0 ``` ## What is a Commit? A commit is a snapshot of your project at a specific moment. Each commit has: - A unique hash (like `a1b2c3d`) - A message describing the change - The author and timestamp ## Best Practices - Start with `git init` or `git clone` to create a repository - Commit often with clear messages - Use branches for experimental work - Never commit sensitive data (passwords, keys) ## Common Mistakes - Forgetting to initialize Git before making changes - Committing too many changes at once - Using vague commit messages like "fix" or "update" - Not backing up your repository regularly
No changes yet
Reset to original
Submit suggestion
cancel