GitHub Collaboration Guide: Contribute Without Forking
Tags: github, git, beginners, tutorial
Published: 2023-09-28 15:08:31

## Introduction:

Contributing to a GitHub repository without forking is a great way to streamline collaboration and keep your GitHub profile tidy. This guide will walk you through the process of adding a collaborator, contributing as a collaborator, and using branches for more efficient contributions.

## Adding a Collaborator as an Author:

1. Open the repository to which you want to add a collaborator. For example, let's say you want to add a collaborator to the "author\_username/zero\_day" repository.
2. Click on "Settings."
![A screenshot image of "Settings tab" in GitHub GUI](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gaphqeh25s6dge85wmg2.PNG)
3. Navigate to "Collaborators."
![A screenshot image of "Collaborators tab" in GitHub GUI](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4hpx4k0pl3w7lpd99p18.PNG)
4. Click on Use GitHub Mobile to confirm access.
![A screenshot of Confirmation process in GitHub](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/284m8qv5r1ebyd04n40u.PNG)
5. Select "Add people."
![A screenshot image of "Add people tab" in GitHub GUI](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2zkspu17e6yaj8n6mek8.PNG)
6. Enter the collaborator's username or full name.
![A screenshot image of where to enter collaborator's user name](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gouct3yx95ho98xq8zva.PNG)
7. Click on Select a Collaborator above.

*An invitation email will be sent to the collaborator.*

## Contributing as a Collaborator:

*Once the author has added you as a collaborator, you will receive an invitation email from GitHub.*

1. Accept the invitation email. Simply click on the provided link to accept the collaboration invitation.
    
2. Open your GitHub account interface. After accepting, you will see the "author\_username/zero\_day" among your existing repositories.
    
3. Open your terminal.
    
4. Clone the new repository using the Git clone command. For instance:
    
    ```bash
    git clone https://{your_personal_token}@github.com/{author_username/zero_day}.git
    ```
    
5. Use "git pull" to retrieve all the updated files. This ensures you have the latest changes from the repository.
    
    ```bash
    git pull
    ```
    

## Working on a Different Branch:

As a collaborator, it's advisable to work on a separate branch to avoid conflicts when pushing your code.

1. Create a new branch. Let's call it "Collabo-branch" as an example:
    
    ```bash
    git branch Collabo-branch
    ```
    
2. Switch to the new branch you created, so your works and changes are isolated:
    
    ```bash
    git checkout Collabo-branch
    ```
    
3. After reviewing and completing your task on the new branch, you can merge it back into the main branch. For example:
    

```bash
git checkout main
git merge Collabo-branch
```

***Always remember to "git pull" after changing to the main branch before you merge.***

By following these steps, you can effectively collaborate on a GitHub repository without forking, thereby making the contribution process more efficient. 

Let me know the challenges you encounter in the comment box, and I will put forth my utmost effort to address them