π§ Git & GitHub: Version Control for Beginners
π
Posted on Jun 29
βοΈ By @sagardoescoding
During my internship with @devsync, one of the most powerful tools I got comfortable with was Git β and how it works with GitHub for version control and collaboration.
If you're a beginner developer, mastering Git & GitHub is an absolute must-have skill. Letβs break it down super simple.
π‘ Why Git & GitHub?
β
Track every change in your codebase
β
Collaborate easily with teams
β
Roll back to previous versions anytime
β
Showcase your work to the world (hello, recruiters!)
π§ Git vs GitHub
Git: A version control system you install on your machine. Think of it as a βtime machineβ for your code.
GitHub: An online platform that hosts your Git repositories, adds collaboration tools, and lets you work with others.
π οΈ Git Basics Every Dev Should Know
β
1. Initialize a Git Repo
git init
β
2. Check Repo Status
git status
β 3. Add Files to Stage
csharp
git add .
β
4. Commit Changes
sql
git commit -m "Your commit message"
β
5. Connect to GitHub
git remote add origin https://github.com/username/repo.git
β 6. Push Code
git push -u origin main
π± Common Git Commands
Command Purpose
git clone Copy a remote repo to your machine
git pull Fetch latest changes from remote
git log View commit history
git branch Manage branches
git merge Merge one branch into another
π Example Workflow
git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin https://github.com/yourusername/yourrepo.git
git push -u origin main
βοΈ Pro Tips
Use .gitignore to exclude files like node_modules, .env, etc.
Write clear commit messages:
βοΈ "stuff fixed"
β
"Fix bug in login validation logic"
π§ͺ Tools That Help
GitHub Desktop β GUI for Git (great for beginners)
GitLens Extension for VS Code β Superpowers for Git
GitKraken β Advanced Git UI
π Final Thoughts
If you're coding without Git β you're flying without a parachute.
Even solo projects benefit from version control and backups.
This is just the start of my Git journey, but it's already made my workflow smoother and more professional.
Top comments (0)