DEV Community

Cover image for 🛠️ Mastering Git & GitHub
lilo-creator
lilo-creator

Posted on

🛠️ Mastering Git & GitHub

On day two i was mastering git and github Below are some of this things i highlighted
**

🚀 1. Forking a Repository

**
Forking means creating your own copy of someone else's GitHub repository.
steps:
Go to any public repo on GitHub and click “Fork”.
Explore the copy created in your account — this is now yours to modify.
🧠 Tip: Think of forking as "duplicating to contribute."

**

🤝 2. Collaboration

**
This is working with others on a shared project.
Steps:
Join a team project or contribute to open source.
Practice using branches to isolate your changes.
Learn to pull updates from the main project to stay in sync.
🔧 Hands-on Task: Clone a team repo, create a new branch, make a change, and push it.

**

🔃 3. Pull Requests (PRs)

**
This is a request to merge your changes into the original repository.
Steps:
After pushing your changes, click “New pull request” on GitHub.
Write a clear title and description for your PR.
Tag someone for review and wait for feedback.
📚 Practice idea: Fork any repo, add a README update, and submit a pull request.

**

⚔️ 4. Merge Conflicts

**
It happens when Git can’t automatically merge two versions of a file.
How to grasp it:
Simulate it: Edit the same line of code on two branches.
Try merging and resolve the conflict using VS Code or terminal.
Commit the resolved file to finalize.
⚠️ Lesson: Always pull the latest changes before pushing yours.

**

👀 5. Code Review

**
This is Reviewing someone else's code before it’s merged.
How to grasp it:
Learn to comment constructively on PRs.
Use GitHub’s "Files changed" tab to explore differences.
Suggest changes or approve if everything looks good.
🤝 Growth Tip: Volunteer to review a teammate’s PR.

**

📝 6. GitHub Issues

**
This is a way to track bugs, tasks, or enhancements.
How to grasp it:
Create an issue to report a bug or propose a feature.
Label it appropriately and assign it to someone (or yourself).
Use it to track progress and link it in your PR.
📌 Try it: Open a new issue in a test repo and reference it in a PR .

**

🧑🏽‍💻 7. Essential Git Commands

**
This are terminal commands that help you control Git.
This are some basic commands:
git clone <repo_url>
git checkout -b new-branch
git add .
git commit -m "your message"
git push origin new-branch
git pull origin main
git merge main

☁️ 8. Pushing Changes to GitHub

This is Uploading your local changes to your online repo.
steps:
After committing your changes, use:
git push origin branch-name
Then Go to GitHub and check your changes online.

Top comments (0)