Question

I am having issues wit a project that I put on github and am working on with two people.
As per the title I am using Netbeans 8 and it's in-built GIT support.

The changes are about one line of one single file.

On the remote repository it the line has the content:

System.out.println("Someone was here.");

I pulled the changes from the remote repo, so I have the same content at my local repo.

Now I change that line to:

System.out.println("I was here.");

Then I can commit and push it just fine! And that is a big issue, because now I have overwritten his changes.

So the question, why did it not trigger the resolve conflicts (merge) window, and how can I make sure that it will be triggered?

I was expected something like, there is a conflict: Your local version has this content, the remote version has that content.

Was it helpful?

Solution

A merge conflict happens when:

  1. 2 users start with the same source file
  2. 2 users edit the same line
  3. 2 users commit their change

I pulled the changes from the remote repo, so I have the same content at my local repo.

You seem to be describing a different scenario:

  1. 2 users start with the same source file
  2. 1 user edits a line and commits
  3. 2nd user gets the 1st user's change
  4. 2nd user edits the line and commits

If that's true, that's not a merge conflict: you have the other user's change; and you edited it on purpose.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top