Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

! [remote rejected] master -> master (failure) error: failed to push some refs to ‘repository URL’

I have already seen the question failed to push some refs to [email protected] and I'm the only developer of the following private repository which just has a master branch

enter image description here

From my searches I've seen that this error typically occurs when your local repository is not up-to-date with the remote repository but I have no idea why I am getting this error?

enter image description here

like image 975
Sepideh Abadpour Avatar asked Jul 22 '19 16:07

Sepideh Abadpour


People also ask

How do I fix error failed to push some refs to git?

If you get a failed to push some refs to error, the main thing to do is git pull to bring your local repo up to date with the remote. Avoid employing the --force flag when using git pull and prevent other developers' accidental overwrites of committed features.

What does failed to push some refs mean?

This means that someone else pushed a commit to the same branch you're pushing to, but you don't have that commit on your laptop yet. This can happen if it has been awhile since you ran "git pull" on a branch that many people contribute to, such as staging. To fix this issue, run: git pull origin <your-branch>

Which error would you get if you try to push master branch changes to a remote repository?

The error message error: refusing to update checked out branch: refs/heads/master is emitted by the remote repository and it means you're trying to push code to remote non-bare repository that has different code currently checked out in the working directory.

How do I push a remote branch code?

Push a new Git branch to a remote repo Clone the remote Git repo locally. Create a new branch with the branch, switch or checkout commands. Perform a git push with the –set-upstream option to set the remote repo for the new branch. Continue to perform Git commits locally on the new branch.


1 Answers

Currently, Github has issues. The problem isn't from your side. (Check github status.)

However, In other cases, the problem maybe that remote repository has commits that doesn't exist locally, but in your case, it's github issue. enter image description here


UPDATE: Github is operational right now.

enter image description here

like image 143
Youssef13 Avatar answered Oct 04 '22 09:10

Youssef13