error: src refspec main does not match any solution

I can't git push

git push origin main

Then

error: src refspec main does not match any

I got an error like this.

Conclusion

The solution is
git push origin HEAD:The name of the branch you want to push

So, I was able to push safely.

Reference article

https://qiita.com/fukkatsu3/items/c488ec9559f6cca34313 I used this as a reference.

Recommended Posts

error: src refspec main does not match any solution
Terminal does not start
error: src refspec main does not match any solution
Sidekiq-limit_fetch does not work
Spring-Boot main class not found
Ruby version does not switch
[JavaScript] Negative rounding does not match Excel
[Error] ActiveRecord :: NoDatabaseError FATAL: database does not exist
About the "Oops VFS connection does not exist" error and solution in AWS Cloud9