Using Git for Version Control
Git is a distributed version control system for tracking changes in source code during software development.
Basic Git Setup
# Install Git
sudo apt install git -y
# Configure your name and email
git config --global user.name "Your Name"
git config --global user.email "youremail@example.com"
CopyCommon Commands
# Clone an existing repository
git clone https://github.com/example/repo.git
# Check the status of your changes
git status
# Add files to be staged for a commit
git add .
# Commit your staged changes with a message
git commit -m "My descriptive commit message"
# Push your committed changes to the remote repository
git push
# Pull the latest changes from the remote repository
git pull
Copy