Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git - The Remote Repository Rejected Commits

Tags:

github

xcode

I created a new branch manually from Xcode, which for some reason did not show up on the repository, so I made another branch from the GitHub browser manually. Then when trying to commit I'm met with the error:

"The remote repository rejected commit. Make sure you have permission to push to the remote repository and try again."

I've talked to my boss who ensured that I'm given written permission, so we're both confused as to why I can't commit properly.

like image 225
Faisal Syed Avatar asked Sep 26 '16 23:09

Faisal Syed


2 Answers

enter image description here

If you have this option selected in the Email Settings page of GitHub it will prevent you from pushing.

like image 148
Luca Angeletti Avatar answered Nov 09 '22 05:11

Luca Angeletti


You need to go in to terminal, and then go to your project directory and type these commands.

xcrun git config user.name "your username here"
xcrun git config user.email [email protected]

Make sure the user name and emails are the exact ones that you use on github, gitlab etc.

like image 2
Munib Avatar answered Nov 09 '22 06:11

Munib