🚀 1. Forking a Repository
Navigate to the repository you want to contribute to on GitHub.
Click the “Fork” button in the top right corner—this creates a copy under your account.
Clone your forked repo with git clone <your-forked-url>
.
Work on it locally, then push your changes back to your fork.
🤝 2. Collaborating on GitHub
Create issues or comments to discuss tasks or bugs.
Assign roles or tasks (especially in teams).
Push branches and create pull requests to contribute your code.
Review PRs and resolve feedback collaboratively.
Keep communication transparent through comments and commit messages.
🔁 3. Creating a Pull Request (PR)
Create a new branch: git checkout -b feature-branch
.
Make your changes and commit them: git add .
and git commit -m "describe changes"
.
Push the branch: git push origin feature-branch
.
Go to GitHub and click “Compare & pull request”.
Add a meaningful title and description, then submit it for review.
⚔️ 4. Resolving Merge Conflicts
Pull the latest changes: git pull origin main
.
If conflicts appear, open the affected files they’ll be marked with <<<<<<< HEAD.
Manually resolve which code to keep or merge.
Add and commit the resolved files.
Push your branch again: git push
.
🧪 5. Doing a Code Review
Go to the pull request, click “Files Changed”.
Review the code—check for clarity, performance, security, and readability.
Leave inline comments or approve/request changes.
Be respectful and specific—help make the code better, not just different.
📋 6. Managing GitHub Issues
Open an issue: title + detailed description.
Label it (bug, enhancement, etc.).
Assign it to contributors or yourself.
Comment updates or progress.
Close the issue once resolved or linked to a merged PR.
🧠 7. Core Git Commands I Learned
git init # Start version control in a folder.
git clone <url> # Copy a repo to your local machine.
git status # Check current changes.
git add . # Stage all changes.
git commit -m "message" # Save staged changes.
git pull # Get the latest code from a remote.
git push # Upload your commits to GitHub.
git checkout -b branch # Create/switch to a new branch.
git merge branch # Merge another branch into the one you're on.
📦 8. Pushing Changes to GitHub
Make sure your local branch is up to date: git pull origin main
.
Add and commit your changes: git commit -m "message"
.
Push to the branch: git push origin your-branch
.
Open or update a pull request with context about your changes.
Top comments (0)