Can't push master branch to git repository with netbeans

烈酒焚心 提交于 2019-12-05 01:31:50

You must be trying to push a new commit to replace an existing commit already push ("history rewritten")

You need to do a git push --force, or select a similar option (if supported) in the git push wizard dialog of NetBeans.
And that suppose that the "push --force" is authorized on the remote repo (which isn't always the case).
If other have already pulled from the remote repo, rewriting its history is generally not a good idea.

Looks like the problem is that your git repository is not bare.

To verify yo can try pushing via git on the command line, it will give more detailed explanation.

The problem might be that master is currently checked out at remote repository. To be able to push master branch you can try checking out something else than master on remote repository.

I had the same issue with push via netbeans (on mac), caused by another circumstance:

I (accidentally) used german umlauts (ü,ä,ö) for the name of my branch when creating it locally. Working locally worked fine until i tried to push it to the remote repository.

My workaround: create another branch locally without umlaut in its name, merge the wrong named branch into it, push the new one to the remote repo.

hope this helps someone saving time while searching the solution.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!