Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a git pull request on a public github repository

There is a public github repository to which I want to create a pull request. I have a project on my local machine that I need to check in and send it to them for review. I have tried the following and failed

git clone public repo
# create new branch
# add code in the branch 
git add/commit changes to this new branch 
git push 

When I do the git push I enter my github account credentials and it fails. I know that this should fail because I don't have access to their repo but what I am doing wrong? Do I need to create some sort of an account with them?

like image 754
p0tta Avatar asked Jun 07 '17 14:06

p0tta


People also ask

Can you create a pull request without a branch?

If you don't have access to create branches on that repository, there is no way to create a pull request without forking.


1 Answers

You first have to fork the project :

enter image description here

Then you can work on your version of the code.

You will finally push your branch to your repository and then you will be able to create a pull request on the main project.

You can find extra info here: Fork a repo or Contribute to someone's repository

PS: Related to How do I contribute to other's code in GitHub?

like image 121
Till Avatar answered Oct 15 '22 14:10

Till