
Github Pages in Git
🚀 How to Send a Pull Request (PR) on GitHub
A Pull Request (PR) lets you contribute to a GitHub repository by suggesting changes. It allows repository maintainers to review your code before merging it into the main project.
📌 Steps to Send a Pull Request on GitHub
1️⃣ Fork the Repository (If Not Yours)
If you're contributing to someone else's project:
- Open the repository on GitHub.
- Click Fork (top-right corner).
- This creates a copy under your GitHub account.
2️⃣ Clone the Repository Locally
Clone the original repo (if it's yours) or your fork (if it's not):
git clone https://github.com/your-username/repository-name.gitcd repository-name
3️⃣ Create a New Branch
Never make changes in the main
branch. Instead, create a feature branch:
git checkout -b feature-branch
or
git switch -c feature-branch
4️⃣ Make Changes & Commit
After editing or adding files:
git add .git commit -m "Added new feature"
5️⃣ Push the Branch to GitHub
Send your changes to your GitHub repo:
git push origin feature-branch
6️⃣ Open a Pull Request (PR)
- Go to your GitHub repository.
- Click "Compare & pull request" next to your branch.
- Add a title and description explaining your changes.
- Click "Create pull request".
7️⃣ Wait for Review
- The repository owner will review your PR.
- They might approve, request changes, or reject.
- If changes are requested, update your branch and push again.
8️⃣ Merge the Pull Request (If Approved)
If you have permission, merge the PR:
- Click "Merge pull request".
- Click "Confirm merge".
- Delete the branch (optional).
If you don’t have permission, the repository owner will merge it.
🔥 Summary
1️⃣ Fork & clone the repo (if needed)
2️⃣ Create a new branch
3️⃣ Make changes and commit
4️⃣ Push changes to GitHub
5️⃣ Open a Pull Request
6️⃣ Wait for review & merge 🚀