Skip to content

git error: failed to push some refs to remote #49593

Answered by s-spoon
SuperJUNOed asked this question in Actions
Discussion options

You must be logged in to vote

And you can rename existing repository default branch from master to main.
The rest of this 2014 answer has been updated to use "main")

(The following assumes github.com itself is not down, as eri0o points out in the comments: see www.githubstatus.com to be sure)

If the GitHub repo has seen new commits pushed to it, while you were working locally, I would advise using:

git pull --rebase
git push

The full syntax is:

git pull --rebase origin main
git push origin main

With Git 2.6+ (Sept. 2015), after having done (once)

git config --global pull.rebase true
git config --global rebase.autoStash true

A simple git pull would be enough.
(Note: with Git 2.27 Q2 2020, a merge.autostash is als…

Replies: 5 comments 8 replies

Comment options

You must be logged in to vote
1 reply
@conceptfac
Comment options

Comment options

You must be logged in to vote
1 reply
@gokuthecoder
Comment options

Answer selected by SuperJUNOed
Comment options

You must be logged in to vote
4 replies
@tochman
Comment options

@almahdi404
Comment options

@ruk93
Comment options

@brenicolas
Comment options

Comment options

You must be logged in to vote
2 replies
@RajeshMoravaneni7
Comment options

@Jesusson-softwareandIT
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Build, test, and automate your deployment pipeline with world-class CI/CD Question