Git & GitHub Documentation
Comprehensive guide to mastering Git and GitHub - from basics to advanced techniques
Documentation
Choose a section to learn
What is Git?
Learn the basics of Git and GitHub
Git is a distributed version control system (DVCS) used to track changes in files and coordinate work between multiple people.
What Git does:
-
Keeps a complete history of every change made to your files Allows you to go back to previous versions at any time
Lets multiple developers work together without overwriting each other's work makes branching easy so you can experiment without breaking the main code
Why developers use Git:
- • Collaboration: Teams can work on the same codebase efficiently
- • Backup: Your history is stored locally and can also be pushed to remote servers like GitHub
- • Experimentation: Try new features safely in branches
- • Version tracking: See exactly who changed what and when
Common Commands
git --versionCheck installed Git version
git helpGet help with Git commands
git initInitialize a new Git repository in the current folder
git statusCheck which files are changed and ready to commit
git add <file>Stage specific file(s) for commit
git add .Stage all changes for commit
git commit -m "message"Save staged changes with a message
git logView commit history
git branchList all branches
git checkout -b <branch-name>Create and switch to a new branch
git merge <branch-name>Merge changes from another branch into the current branch
git remote add origin <repo-url>Connect local repo to remote repository
git push origin mainPush changes to the main branch on remote
git pullFetch and merge changes from remote repository
Quick Start Guide
Essential Git commands to get you started immediately
First Time Setup
git config --global user.name Your Namegit config --global user.email you@example.comDaily Workflow
git add .git commit -m messagegit push origin main