This guide provides all the steps needed to collaborate on this repository, including setting up a local copy, creating a separate branch, staying updated with the main branch, and pushing changes.
- Cloning the Repository
- Creating a New Branch
- Making Changes
- Committing Changes
- Keeping Your Branch Updated with the Main Branch
- Pushing Changes to the Remote Repository
- Creating a Pull Request
-
Open the GitHub repository page (the main repository you want to contribute to).
-
Click on the Code button and copy the HTTPS or SSH link.
-
Open your terminal (e.g., Command Prompt, Git Bash) and clone the repository by running:
git clone <repository-url>
To keep your work separate from the main branch, create a new branch.
-
Create and switch to a new branch with a descriptive name:
git checkout -b <branch-name>
- Open the repository files in a code editor and make the necessary changes.
- Once you’re done, save your changes.
-
After making your changes, add them to the staging area by running:
git add . git commit -m "Brief description of changes"
To stay up to date with the latest changes on the main branch, follow these steps:
- Switch to the main branch:
git checkout main
- Pull the latest changes from the remote main branch:
git pull origin main
- Switch back to your branch
git checkout <branch-name>
- Merge the main branch into your branch to incorporate latest updates:
git merge main
Once your branch is updated and your changes are ready:
-
Push your branch to the remote repository:
git push origin <branch-name>
- Go to the GitHub repository page in your browser.
- You should see a notification to create a pull request for your branch. Click on Compare & pull request.
- Add a title and description for your pull request, then click Create pull request