Skip to content

Instantly share code, notes, and snippets.

@arya2004
Created July 27, 2024 12:52
Show Gist options
  • Select an option

  • Save arya2004/485145f7966e6947db4d881bb65259b4 to your computer and use it in GitHub Desktop.

Select an option

Save arya2004/485145f7966e6947db4d881bb65259b4 to your computer and use it in GitHub Desktop.
How to Contribute to GitHub Repository

Step 1: Fork the Repository

  1. Navigate to the Repository: Go to the GitHub page of the repository you want to contribute to.

Screenshot from 2024-07-27 18-02-57

  1. Fork the Repository: Click the Fork button in the upper right corner of the repository page. This will create a copy of the repository in your own GitHub account.

Screenshot from 2024-07-27 18-03-08

  1. Fork visible on Profile:

Screenshot from 2024-07-27 18-03-52

Step 2: Clone the Forked Repository

  1. Open Terminal or Command Prompt: Use your terminal or command prompt to interact with GitHub.

Screenshot from 2024-07-27 18-04-33

  1. Clone the Repository: Clone the forked repository to your local machine using the following command:
    git clone https://github.com/YOUR-USERNAME/Team_24-25.git
    Replace YOUR-USERNAME with your GitHub username.

Step 3: Change Directory

  1. Navigate to the Cloned Directory: Change directory to the cloned repository:
    cd REPOSITORY-NAME

Step 4: Create a New Branch

  1. Fetch Upstream Changes: Ensure your fork is up-to-date with the original repository:
    git fetch upstream
    git checkout main
    git merge upstream/main

Screenshot from 2024-07-27 18-07-10

  1. Create a New Branch: Create a new branch for your changes:

    git checkout -b your-branch-name

    Replace your-branch-name with a descriptive name for your branch.

    Screenshot from 2024-07-27 18-09-08

Step 5: Make Your Changes

  1. Make Changes: Implement your changes in the codebase using your preferred code editor.

Screenshot from 2024-07-27 18-09-18

  1. Stage Changes: Add the changes to the staging area:

    git add .
  2. Commit Changes: Commit your changes with a meaningful commit message:

    git commit -m "Description of the changes made"

Step 6: Push Changes to GitHub

  1. Push Changes: Push your branch to your forked repository on GitHub:
    git push origin your-branch-name

Screenshot from 2024-07-27 18-10-28

Step 7: Create a Pull Request

  1. Navigate to Your Forked Repository: Go to the GitHub page of your forked repository.

Screenshot from 2024-07-27 18-10-42

  1. Create a Pull Request: Click the Compare & pull request button next to your branch.
  2. Fill Out Pull Request Details: Provide a descriptive title and detailed description of your changes. Include any relevant issue numbers if applicable.
  3. Submit Pull Request: Click Create pull request.

Screenshot from 2024-07-27 18-11-25

Step 8: Respond to Feedback

  1. Review Feedback: Review any comments or feedback provided by the repository maintainers.
  2. Make Necessary Changes: If requested, make the necessary changes and push them to your branch. The pull request will update automatically.

Screenshot from 2024-07-27 18-12-08

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment