tags:

views:

253

answers:

1

I can't for the life of me find any decent explanation of the "[file]: needs update" message that git sometimes spits out from time to time. Even the official git FAQ has explaining this marked as a TODO. If someone could explain A) what it means; and B) how to fix it, I would be extremely grateful.

+7  A: 

It means you're trying to merge changes from somewhere, but the changes include modifications to a file that's dirty (currently modified in your working tree). You need to commit your outstanding changes, or stash them, pull/rebase/merge/whatever you're doing to update, and unstash

Michael Mrozek
It's not actually the pull - it's the merge that's part of the pull. You'll see the same error if you try to merge a local branch with the same problem, and I think other mergey operations (apply, stash apply...) print similar errors if not the same one.
Jefromi
Ah, good call. Fixed
Michael Mrozek
Ah, thanks. That actually makes sense. I guess I need to make sure I commit changes before checkout out a different branch.
endtime