Faisal Syed
Faisal Syed

Reputation: 931

Git - The Remote Repository Rejected Commits

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.

Upvotes: 9

Views: 10683

Answers (3)

Luca Angeletti
Luca Angeletti

Reputation: 59526

enter image description here

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

Upvotes: 24

Mohit Singh
Mohit Singh

Reputation: 1460

I was using "Personal Access Token" for authentication and was facing the same issue. For some reason, generating a new token and entering it again in Xcode -> Preferences -> Accounts fixed it.

Upvotes: -1

Munib
Munib

Reputation: 967

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.

Upvotes: 2

Related Questions