Hey everyone
Welcome back to Day 2 of my dev journey! Yesterday I shared how I set up my development environment. Today, I dove deep into something every developer needsโGit and GitHub. If youโve ever wondered whatโs the difference between a fork and a clone? or how to handle merge conflicts without panickingโthis is for you!
โ 1.Why Git? Why GitHub?
Git helps you track your code history, collaborate easily, and avoid the fear of "what if I break something?".
GitHub is where your Git projects live online so others can contribute, comment, or review.
2. Basic Git Commands I Practiced
Use code blocks and explain them simply:
git init
git add .
git commit -m "Initial commit"
git remote add origin <your-repo-url>
git push -u origin main
lets get started,
๐ฑ
Step 1: Forking a Repository
๐ฏ Goal: Make a personal copy of a project to work on.
๐ Steps:
Go to the GitHub repo you want to contribute to.
Click the Fork button at the top-right.
A new copy appears in your GitHub account.

โ
You now have your own copy to work with freely.
๐ค Step 2: Cloning & Setting Up Collaboration
๐ฏ Goal: Download your forked repo to your computer.
Copy the repo URL from GitHub
git clone https://github.com/your-username/repo-name.git
Move into the folder
cd repo-name
โ
Youโre ready to start working locally.
๐ฑ Step 3: Create a New Branch
๐ฏ Goal: Work in isolation from the main branch.
๐ Steps:
git checkout -b feature-branch-name
โ Your changes are safe in this new branch.
โ๏ธ Step 4: Make Changes and Commit
๐ฏ Goal: Save your changes with a message.
๐ Steps:
Stage your changes
git add .
Commit with a message
git commit -m "Add feature or fix"
โ
Your progress is recorded in Git history.
๐ Step 5: Push Changes to GitHub
๐ฏ Goal: Upload your changes online.
๐ Steps:
git push origin feature-branch-name
โ
Now your changes are visible on your GitHub fork.
๐ Step 6: Create a Pull Request (PR)
๐ฏ Goal: Request to merge your changes into the original project.
๐ Steps:
Go to your fork on GitHub.
Click Compare & pull request.
Add a descriptive title and summary.
Click Create pull request.
โ
Youโve asked the project owner to review and merge your work.
๐ Step 7: Code Review
๐ฏ Goal: Let collaborators check your work.
๐ Steps:
Reviewers may leave comments.
If changes are requested:
Make the fix
git add .
git commit -m "Fix review suggestions"
git push
โ Code reviews help keep the project clean and consistent.
โ๏ธ Step 8: Resolve Merge Conflicts
๐ฏ Goal: Fix code clashes when multiple people edit the same line.
๐ Steps:
git pull origin main
If there's a conflict, Git will mark it like this:
<<<<<<< HEAD
your version
other version
main
Fix it manually, then:
git add .
git commit -m "Resolve merge conflict"
git push
โ Merge conflict resolved.
โ Step 9: Use GitHub Issues
๐ฏ Goal: Report bugs or suggest new features.
๐ Steps:
Go to the repo's Issues tab.
Click New Issue.
Describe the problem or idea clearly.
Submit it.
โ A great way to manage and track tasks.
๐งช Step 10: Must-Know Git Commands
Command Description
git clone URL Copy project from GitHub
git status See what's changed
git add . Stage all changes
git commit -m "msg" Save changes
git push Upload to GitHub
git pull Fetch latest changes
git checkout -b branch Create new branch
โ
Final Workflow Summary
1. Fork the repository
2. Clone to your computer
3. Create a new branch
4. Make and commit changes
5. Push changes to GitHub
6. Open a pull request
7. Collaborate through code reviews
8. Fix merge conflicts
9. Use issues for collaboration
10. Repeat as needed
๐ฌ Bonus Tip
๐ก Always run git pull before you push to avoid conflicts.
๐ฏ Use clear commit messages and PR titles to help your teammates.
Top comments (1)
Well written article