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)