Skip to main content

Collaborating on GitHub

Welcome to the Git & GitHub Tutorial Series by CodeHarborHub. GitHub isnโ€™t just for hosting code, itโ€™s a powerful platform for team collaboration. This tutorial will guide you through the tools and workflows developers use to work together efficiently.

1. Understanding GitHub Repositoriesโ€‹

A repository (repo) is the central place for your project. It can be:

  • Public โ†’ visible to everyone, ideal for open-source projects.
  • Private โ†’ visible only to selected collaborators or teams.

Repository Componentsโ€‹

  • Code: All project files
  • Issues: Track tasks, bugs, or ideas
  • Pull Requests (PRs): Propose changes to the codebase
  • Actions: Automate CI/CD workflows
  • Projects: Organize tasks using Kanban boards
  • Wiki: Document project knowledge

2. Forking & Cloningโ€‹

To contribute to someone elseโ€™s project:

  1. Fork the repository โ†’ creates a copy under your GitHub account.

  2. Clone the fork โ†’ download it to your local machine:

    git clone https://github.com/your-username/forked-repo.git
  3. Add the original repository as upstream:

    git remote add upstream https://github.com/original-owner/repo.git
info

This ensures you can sync your fork with the main project later.

3. Pull Requests (PRs)โ€‹

A Pull Request is how you propose changes to a repository.

Workflowโ€‹

  1. Create a feature branch:

    git checkout -b feature/add-login
  2. Make your changes and commit:

    git add .
    git commit -m "Add login functionality"
  3. Push your branch to GitHub:

    git push origin feature/add-login
  4. Open a Pull Request on GitHub:

    • Compare your feature branch with the main branch
    • Add a meaningful title and description
    • Submit for review

Best Practices for PRsโ€‹

  • Keep PRs small and focused
  • Include screenshots or examples if UI changes
  • Write clear, concise descriptions
  • Reference related issues (#issue-number)

4. Issuesโ€‹

Issues help track tasks, bugs, feature requests, and discussions.

Creating an Issueโ€‹

  1. Go to the Issues tab
  2. Click New Issue
  3. Add a descriptive title and detailed description
  4. Assign labels, assignees, or milestones

Using Issues Efficientlyโ€‹

  • Bug โ†’ for errors or unexpected behavior
  • Feature Request โ†’ for new functionalities
  • Discussion โ†’ for planning or ideas
  • Good First Issue โ†’ ideal for beginners contributing to open-source

5. Code Reviewโ€‹

Code reviews ensure quality and maintainability.

How to Perform a Reviewโ€‹

  • Comment inline on specific lines of code
  • Approve or request changes
  • Suggest improvements with actionable feedback

Reviewer Best Practicesโ€‹

  • Be constructive, not critical
  • Ask questions if unsure
  • Focus on logic, style, and tests

Pull Requests usually require at least one reviewer approval before merging.

6. Project Boardsโ€‹

GitHub Project Boards help manage workflows:

  • Kanban style: Columns like To Do, In Progress, Done
  • Track issues and PRs visually
  • Assign tasks to team members
  • Integrate with GitHub Actions for automation

7. Managing Teams & Permissionsโ€‹

Repositories can have multiple collaborators with different roles:

RolePermissions
OwnerFull access, manage repo & teams
AdminManage settings, workflows, and collaborators
WritePush commits and manage issues/PRs
ReadView repository content only

Teams make collaboration easier for organizations and open-source projects.

  1. Fork โ†’ Clone โ†’ Create a branch
  2. Make changes โ†’ Commit โ†’ Push
  3. Open PR โ†’ Request review
  4. Review & address feedback
  5. Merge โ†’ Delete branch โ†’ Sync fork

This workflow keeps repositories clean and collaborative.

Summaryโ€‹

FeaturePurpose
RepositoryCentral place to store project files
Fork & CloneWork on someone elseโ€™s project safely
Pull RequestPropose code changes for review
IssuesTrack tasks, bugs, and discussions
Code ReviewEnsure quality and provide feedback
Project BoardsOrganize tasks and workflow visually
Teams & PermissionsManage contributors and access

Next Upโ€‹

After mastering collaboration, itโ€™s time to dive into GitHub Profile & Repositories โ€” learn to showcase your work and set up a professional GitHub presence. ๐Ÿ‘‰ Next: GitHub Profile & Repositories โ†’

Additional Resourcesโ€‹


๐Ÿ’™ This tutorial is part of the CodeHarborHub Git & GitHub series โ€” helping developers collaborate effectively and contribute to projects worldwide.