๐ Mastering Git & GitHub: A Quick Guide for Beginners!


If you are stepping into the world of development, Git and GitHub are essential skills you must master. Hereโs a simple and complete guide to get you started! ๐
๐ Setting Up Git
Install Git from git-scm.com
Configure your identity:
bashCopyEditgit config --global user.name "Your Name" git config --global user.email "your-email@example.com" git config --global color.ui auto
๐ Creating a GitHub Repository
Sign in to GitHub.
Click the โ+โ icon โ New repository.
Name your project, add a description, and choose Public/Private.
Initialize with a README (recommended).
Start collaborating and showcasing your work!
๐ฅ Essential Git Commands
Action | Command |
Initialize a repository | git init |
Stage files | git add <file> or git add . |
Commit changes | git commit -m "your message" |
Check status | git status |
View commit history | git log |
Create a branch | git branch <branch-name> |
Switch branches | git checkout <branch-name> |
Merge branches | git merge <branch-name> |
Push changes | git push origin <branch-name> |
Pull updates | git pull |
Clone repository | git clone <repo-url> |
๐ Forking and Updating Repositories
Fork a repository to create your own copy:
Click Fork on GitHub.
Clone the fork:
bashCopyEditgit clone https://github.com/your-username/forked-repo.git
Keep your fork updated:
bashCopyEditgit remote add upstream https://github.com/original-owner/original-repo.git git fetch upstream git checkout main git merge upstream/main git push origin main
โจ Bonus Tips
๐น Undo staged changes:
bashCopyEditgit reset <file>
๐น Temporary save with stash:
bashCopyEditgit stash
๐น Rebase to clean commit history:
bashCopyEditgit rebase main
๐น Ignore files:
Create a .gitignore
file and list patterns to exclude.
๐ Final Note
๐ต Git is your local version control tool.
๐ฃ GitHub is your cloud collaboration platform.
๐ Conclusion
Git is the engine behind your projectโs timeline.
GitHub is the showroom where you display your projects to the world.
Start small, practice daily, and soon youโll be collaborating like a pro! ๐ฉโ๐ป๐จโ๐ป
Subscribe to my newsletter
Read articles from Sonica Sonawane directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Sonica Sonawane
Sonica Sonawane
Hi, I'm Sonica! ๐ Iโm currently diving into the world of DevOps, focusing on AWS, Docker, Kubernetes, Linux, and GitHub. My passion lies in automating systems, building cloud infrastructure, and optimizing workflows. Iโm committed to continuous learning, hands-on projects, and sharing my journey with others in the tech community. Before shifting to DevOps, I worked in IT Sales, where I gained valuable skills in client communication, requirement gathering, and problem-solving. This experience taught me how to connect technical solutions to business needs, which has been instrumental as I transition into DevOps, where technical expertise and problem-solving go hand in hand. Now, Iโm eager to apply my sales experience alongside my growing technical skills in cloud engineering and DevOps. Join me as I explore the latest trends, challenges, and solutions in the world of cloud computing!