Here’s a concise guide to common Git commands for version control:
🧩 Basic Workflow
git init
Initialize a new repository.git_logogit add .
Stage all changes in the current directory.staging_areagit commit -m "message"
Commit staged changes with a message.commit_icon
🌐 Branch Management
git branch <branch-name>
Create a new branch.branch_managementgit checkout <branch-name>
Switch to an existing branch.switch_branchgit merge <branch-name>
Merge changes from another branch.merge_icon
🔄 Remote Operations
git remote add origin <repository-url>
Link to a remote repository.remote_repogit push origin <branch-name>
Push local changes to the remote branch.push_icongit pull origin <branch-name>
Fetch and merge remote changes.pull_icon
🔍 Useful Tips
Check status:
git status
status_checkView commit history:
git log
log_historyStash changes:
git stash
stash_icon
For deeper understanding, explore our Git Tutorial section. 🌱