How to Use GitHub Like a Pro in 5 Minutes
GitHub is where developers collaborate, share code, and contribute to projects. If youβre new, it can feel overwhelming, but donβt worry. In this 5-minute crash course, youβll learn the essentials:
Letβs go! β±οΈ
Make sure you have Git installed:
git --versionIf not, install it:
Set up your name & email (so commits are linked to your GitHub profile):
git config --global user.name "Your Name"
git config --global user.email "you@example.com"Find a repo on GitHub (e.g., your project or an open-source one). Copy the HTTPS link and run:
git clone https://github.com/username/repo.git
cd repoThis creates a local copy of the project.
Edit files with your favorite editor (like VS Code). Then run:
git add .
git commit -m "Added my first feature"β
git add . β stages all changes
β
git commit -m β saves a snapshot with a message
To upload your changes back:
git push origin main(Replace main with your branch name if different.)
Now check your repo on GitHub, your changes are live π.
Never commit directly to main when working on big projects. Create a branch:
git checkout -b feature-new-uiDo your edits, commit, then push:
git push origin feature-new-uiNow open GitHub β youβll see an option to create a Pull Request (PR). This is how you suggest changes in open-source projects.
In just 5 minutes, you learned how to:
Clone a repo
Commit changes
Push to GitHub
Use branches & pull requests
Thatβs all you need to start contributing like a pro π¨βπ». From here, you can dive deeper into rebasing, resolving merge conflicts, and GitHub Actions.