Home > other >  failed to push to laravel repository premission denied
failed to push to laravel repository premission denied

Time:10-04

i am trying to contribute to laravel . I wrote some code and created a new branch and when i try to push the code on git i get this error :

enter image description here

i cloned the repo with ssh and I am pretty sure that i can push and pull from git , i also tried to update my git credentials but again no luck with it . any idea what can be wrong here ?

detail of console :

15:26:48.303: [framework] git -c core.quotepath=false -c log.showSignature=false checkout -b feat/add-first-or-fail-to-query-builder HEAD --
Switched to a new branch 'feat/add-first-or-fail-to-query-builder'
M   src/Illuminate/Database/Query/Builder.php
15:28:35.310: [framework] git -c core.quotepath=false -c log.showSignature=false add --ignore-errors -A -f -- src/Illuminate/Database/Query/Builder.php
warning: LF will be replaced by CRLF in src/Illuminate/Database/Query/Builder.php.
The file will have its original line endings in your working directory
15:28:35.472: [framework] git -c core.quotepath=false -c log.showSignature=false commit -F C:\Users\farsh\AppData\Local\Temp\git-commit-msg-.txt --
[feat/add-first-or-fail-to-query-builder 18d0b9917a] add the firstOrFail function to the query builder
 1 file changed, 17 insertions( )
15:28:42.758: [framework] git -c core.quotepath=false -c log.showSignature=false push --progress --porcelain origin refs/heads/feat/add-first-or-fail-to-query-builder:refs/heads/feat/add-first-or-fail-to-query-builder --set-upstream
ERROR: Permission to laravel/framework.git denied to farshadff.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

enter image description here

CodePudding user response:

Usually, you cannot directly push to a public repository used by many users: there often is a limited list of contributors, who can contribute to the repository.

You should fork the repository first, change your local origin URL to that fork, and push to it (which you will be able to do, since you would be the owner of the new repository.

cd /path/to/local/repository
git remote set-url origin https://github.com/<me>/framework.git

From there, make a pull request between your branch and laravel/framework.git main branch.

  •  Tags:  
  • git
  • Related