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)