3

I often see the below errors on doing git pull on totally untouched files which I am NOT working on.

Pull is not possible because you have unmerged files

It is clear the conflicted files have changed in the git repo. But I don't understand why git pull cannot over-write on these untouched files - which I've not touched?

What can I or my team do to avoid getting these errors?

Edited - Along with the solution I want to understand why the errors are coming.

Just to make clear, the other team members are working on other files (say xyz). And I am working on a separate set of files having no dependency on xyz files. So if I pull the repo changes after a long time with no changes from my side in xyz, why the conflicts in those files?

R11G
  • 1,941
  • 8
  • 26
  • 37
  • 1
    Resolve your conflicts when they happen. You can't just leave conflicting files full of commit marker garbage laying around in your working directory – user229044 Jun 19 '13 at 13:54
  • 1
    @meagar Yes. Ofcourse I'll have no option but to resolve the conflicts happening. But what I want to know is why/how those conflicts are happening on files _untouched by me_. – R11G Jun 19 '13 at 14:09

2 Answers2

3

use git diff to see problem files

look at this git cheat shets for usefull commands

http://www.cheat-sheets.org/saved-copy/git-cheat-sheet.pdf

http://jan-krueger.net/wordpress/wp-content/uploads/2007/09/git-cheat-sheet-v2-back.svg

There are some tips from my own experience. i'm not sure whether they're 100% corerect)

  1. Split work with your team on paralel threads. Try not to work in the same files.

  2. Try to avoid situations when 2 or more persons are adding new files simalteniously. When one added new files others should make pull as soon as possible

  3. the last but not least - make git push very often. this will keep your project git up to date

ShadowFlame
  • 2,996
  • 5
  • 26
  • 40
Roma
  • 1,107
  • 9
  • 19
1

Since git pull does not pull individual files, it's git merge phase will stop for manual correction of any merge conflicts. git merge and/or git pull (and by nature of the fact that git pull is essentially git fetch followed by git merge) is an all-or-nothing operation - you either successfully merge the changes introduced on both (or all) of the branches you are merging together, or you don't merge any of them. The catch in that is when conflicts arise that must be manually resolved - but in that situation, you are in an in-between state, having neither completed and committed the merge nor rolled it back to your previous state.

The message you are getting implies that you have previously done a git pull or a git merge, which stopped in the middle, requesting that you manually resolve some conflicts, which you have not yet done, but have rather continued on doing other stuff, and are now trying to do another git pull / git merge without ever having completed the first one. Take a look at git status, and follow the suggested directions for either resolving your in-progress merge issues or resetting back to a not-in-the-middle-of-a-merge state.

twalberg
  • 59,951
  • 11
  • 89
  • 84
  • 1
    I don't think what you mentioned in the later part of the answer has happened. Just to make clear, the other team members are working on other files (say xyz). And I am working on a separate set of files having no dependency on xyz files. So if I pull the repo changes _after a long time_ with no changes from my side, why the conflicts in those files? – R11G Jun 19 '13 at 15:13