Git is a distributed version control system (DVCS) that allows multiple developers to work on a project simultaneously. It keeps track of changes to files and coordinates work on those files among multiple people. Git is used to manage source code history, enabling developers to revert to previous versions and collaborate effectively.
Key Features:
- Distributed system: Every developer has a local copy of the entire project history.
- Efficient branching and merging.
- Supports non-linear development through branches.
- Lightweight and fast.
Example Code:
# Initialize a new Git repository
git init
# Add a file to the staging area
git add filename.txt
# Commit changes with a message
git commit -m "Initial commit"