Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not able to do pull request #95068

Open
armycodes opened this issue Mar 6, 2025 · 6 comments · Fixed by #95174
Open

not able to do pull request #95068

armycodes opened this issue Mar 6, 2025 · 6 comments · Fixed by #95174

Comments

@armycodes
Copy link

Image

Can anyone help me please, im stuck at pull request

@Harshadc5
Copy link

Do this step wise,
step 1:- Check for Local Changes
If no changes, then modify a file.

Step 2:- Commit & Push Changes:

Step 3:- Refresh GitHub & Try Again:
Go to the pull request page and ensure:
Base repository: firstcontributions/first-contributions
Base branch: main
Head repository: armycodes/first-contributions
Compare branch: firstgit

@sathwikhbhat
Copy link

First, fork this repository to your profile. Make the necessary changes, commit and push them, and then create a pull request.

@armycodes
Copy link
Author

hey first of all thanks for your help ive done everything you have mentioned still couldnt do the pull request

@Harshadc5
Copy link

do this

Check for New Changes

Go to the original repository (firstcontributions/first-contributions). then Click Fetch upstream in your forked repository. then If updates exists, pull the latest changes to your fork.
and you will be done

github-actions bot pushed a commit that referenced this issue Mar 8, 2025
* Updated contributors.md to allow PR

* Updated contributors.md to allow PR
@Roshanjossey Roshanjossey reopened this Mar 9, 2025
@Roshanjossey
Copy link
Member

@armycodes, I've checked your branch. https://github.com/armycodes/first-contributions/tree/firstgit

I don't see any commits from you.

Either you haven't committed any changes or you haven't pushed it to this branch.

@sreekutty-434
Copy link
Contributor

Hi,

Image

Steps to Create a Pull Request (PR) on GitHub*
Fork the Repository (if you don't have write access):

If you're contributing to a repository where you don't have write access, you need to fork the repository first.

Go to the repository on GitHub and click the "Fork" button at the top-right corner. This creates a copy of the repository under your GitHub account.

Clone the Repository:

Clone the repository to your local machine using the following command:

bash
Copy
git clone https://github.com/your-username/repository-name.git
Replace your-username with your GitHub username and repository-name with the name of the repository.

Create a New Branch:

Always create a new branch for your changes. This keeps your work isolated from the main branch.

bash
Copy
git checkout -b your-branch-name
Replace your-branch-name with a descriptive name for your branch.

Make Changes and Commit:

Make the necessary changes to the code.

Stage your changes:

bash
Copy
git add .
Commit your changes with a meaningful message:

bash
Copy
git commit -m "Your commit message"
Push Your Changes to GitHub:

Push your branch to GitHub:

bash
Copy
git push origin your-branch-name
Create a Pull Request:

Go to the repository on GitHub.

You should see a banner at the top of the repository page prompting you to create a pull request for the branch you just pushed. Click "Compare & pull request".

If you don't see the banner:

Go to the "Pull requests" tab.

Click "New pull request".

Select your branch (your-branch-name) as the compare branch and the target branch (usually main or master) as the base branch.

Add a title and description for your pull request.

Click "Create pull request".

Image

Why You Might Not Be Able to Create a Pull Request
If you're unable to create a pull request, here are some common reasons and solutions:

No Changes to Compare:

If there are no differences between your branch and the target branch, GitHub won't allow you to create a pull request.

Solution: Ensure you've made changes and pushed them to your branch.

Branch Conflicts:

If your branch has conflicts with the target branch, GitHub may block the PR creation.

Solution: Resolve conflicts by merging the target branch into your branch locally:

bash
Copy
git checkout your-branch-name
git pull origin main
Resolve any conflicts, commit the changes, and push again.

No Write Access to the Repository:

If you don't have write access to the repository, you need to fork the repository first and create a PR from your fork.

Solution: Fork the repository, push your changes to your fork, and create a PR from there.

Protected Branches:

If the target branch (e.g., main) is protected, you may not be able to create a PR directly.

Solution: Check with the repository maintainers to ensure you have the necessary permissions.

GitHub UI Issues:

Sometimes, GitHub's UI might not show the "Create pull request" button due to a glitch.

Solution: Refresh the page or try creating the PR from a different browser or device.

Incorrect Branch:

If you're trying to create a PR from the wrong branch, GitHub won't allow it.

Solution: Double-check that you're selecting the correct branch for both the compare and base branches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants