Reputation:
So I just installed and set up my first Git repo.
I came across that error while trying to push an update. What I tried to do:
What is the issue here and what can I do to resolve it?
Upvotes: 10
Views: 6925
Reputation: 320
When you push to an empty repository you must set on checkbox "Push current branch to alternative branch" and choose master
as that alternative.
It's because master
is not created yet (repo is really empty). But doing this way you can pretend to initialize the repository.
While that checkbox is off and repository is empty, IDEA can't push, because its interface must be safe and he will not just create new brach if the one in which you pushed last accidentally disappeared (or just not exist). You must force that "branch creation"
UPD By the way currently latest IntelliJ versions can push to a nonexistent branches. Now it's shown just with adding prefix '+' to the name of branch in origin.
In the Push Commits dialog it looks like
bugfix/PML-239 -> origin:+bugfix/PML-239
Upvotes: 16
Reputation: 31
In my case, after setting up my remote repository, I simply made a fetch and then the push worked just fine.
Upvotes: 3
Reputation: 1641
I've resolved this with turning on checkbox "Push current branch to alternative branch". Not sure, but we need this for first push to new branch as it have status as 'untracked'.
Upvotes: 4