Git merging header named origin / master failed due to these files in Netbeans

We work with Netbeans and sometimes get an error when pulling / pushing from git

git Failed to merge the head named origin / master because of these files: "... / Filename.java"

What we can do? How to solve this in netbeans? We all tried -> commit -> pull - same error -> commit -> push - same error

there are no windows where we can resolve conflicts.

Edit:. When I do this: git pull using the git shell, then it will work, the file will show me the conflict ...

But if I do git pull through netbeans, netbeans doesn't show me anything, it saves the file as is, without putting

<<<<<< HEAD:file.java blablabla ======== blabla >>>>>>> 77976da35a11db4580b80ae27e8d65caf5208086:file.java 

inside.

+8
source share
5 answers

I would suggest that the file was not tracked and you created it, while the other created it and sent it to your remote.

I suggest you create stash , pull changes, and then stash pop . This will probably create a conflict (as you say), but it can be resolved using the Netbeans merge editor.

Just resolve the conflict and you're done.

Alternatively, you can commit your file locally and then fetch + rebase to origin/master (or depending on what your remote branch is). You will again get a conflict, almost the same as the first option.

+7
source

I ran into the same problem. I assume you are using git in Netbeans. Try running the command in the git shell. You will see the difference.

+3
source

I recently had the same problem as I could not combine traction. I am doing everything in the correct sequence, but when you change the changes after some user has made the changes, he will refuse. I copied the command that Netbeans sent and pasted into the command prompt window. Despite the explosion in Netbeans, it does a great job of merging from the command line. Then I was able to accurately push.

+2
source

In Netbeans, before performing any pull or push actions, use Git> Show Changes to see if there are any uncommitted changes. Once you solve them, you can click and pull without errors.

See also: stack overflow

0
source

I also had the same issue while I was posting my code in Git through NetBeans ide.

Mistake error for head / master

0
source

All Articles