Now that you've installed Git and configured it, it's time to start using it. This topic covers creating repositories, tracking changes, making commits, and understanding basic Git workflows.
Navigate to your project folder and run:
// Initialize a new Git repository
git init
// Clone a remote repository to local system
git clone <repository-url>
// Show modified, staged, and untracked files
git status
// Add a specific file to staging area
git add file.txt
// Add all project files to staging area
git add .
// Commit staged changes with message
git commit -m "Initial commit"
// View commit logs
git log
// Push local commits to remote branch
git push origin main
// Fetch and merge changes from remote
git pull origin main
// Create a new branch
git branch feature-login
// Switch to another branch
git checkout feature-login
// Create and switch branch in one command
git checkout -b feature-ui
Working Directory → Staging Area → Repository → Remote
This flow helps track, review, and safely share your code changes.