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
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?
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.
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>
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.
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.
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.
UPDATE: Github is operational right now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With