1

I just created a new repo and it had the "main" branch as the default branch. When I try to push to main I get the following error

error: failed to push some refs to

However, if I create a new branch master, I can push to it without any problem.

1
  • Post the entire error you get and the command you use. Dec 5, 2020 at 13:37

1 Answer 1

0

For your first push, assuming your are on the local branch main yourself, you would do:

git push -u origin main

If you are on a local master branch:

Then the git push -u origin main will work.

4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.