I have a question in GIT pull process.
Let us say, I am working on local file called "Program.java". (lets assume that I cloned the repo initially from remote). And after I finish my changes, I commit them in my local repository.
Meanwhile when I worked locally, someone updated the same file "Program.java" in the remote branch. The change what the other person made was, addition of some lines at the end of the file. The changes I made locally was, addition of few lines at the beginning of the file.
Now when I invoke 'git pull', git silently fast forwards the merge between my local and remote branches!!
This is not correct. Isn't it ? Ideally it should have shown conflicts. Because, someone modified the same file remotely while I think that nothing was modified in the Program.java file.
When I test the program (Program.java), I realize that there was some modification happened at remote and finally I end up catching the guy who performed the update and correct my file.
This is dangerous and git, rather fast forwarding the merge, should have shown conflicts. This would have alerted me before I sensed the updated from other person.
Can someone please hep me to understand why this happens in GIT.
Note: Git shows conflict if the same line was updated between remote and local branches which is exactly was expected.
Thanks in advance.