Monday, January 24, 2011

Git (out of there)

This morning I ran into a bit of a snag updating the auldsbel.dyndns.org tmw server. When I did the git stash and git pull I got the following message:


From git://gitorious.org/tmw-eathena-data/mainline
 + f0154b9...446c7da master     -> origin/master  (forced update)
CONFLICT (delete/modify): .mailmap deleted in 446c7dae4c5a37ccb23b22a103a1f28a6b67fdc0 and modified in HEAD. Version HEAD of .mailmap left in tree.
Automatic merge failed; fix conflicts and then commit the result.

I haven't deleted anything, but I have made several of my own modifications to the source, most of which has been just to add (versus change) npcs. I really didn't want to commit my changes because many are me just playing around. I haven't touched the file .mailmap, so not quite sure whether to delete the file and try to pull it again, or to see if I can match it up to some other .mailmap...

2 comments:

  1. Of note here is what git says on the line that specifies the change in the remote master branch. It says "(forced update)". This basically means that since the last time you were looking at the remote 'master' branch, it has been rewinded (and after that probably had some other commits added to it).

    Rewinding a branch is generally a very evil thing to do, and I don't know the reason why the master branch of tmw-eathena-data was changed in this way. The message about the .mailmap file indicates that there used to be a change to the .mailmap file on the master branch, but the new branch no longer has this change (and actually has a deletion of this file).

    By doing a 'git pull', you're trying to merge the new master branch with the previous one, but that doesn't make sense to do, since there was some reason to get rid of the commits that are now missing on the new master branch.

    If you have no local commits, the best way to update your repository (when a forced update happens) is to stash any local changes and then do a 'git reset --hard origin/master'. That will update your local master branch to exactly the remote one, without attempting to merge them together.

    Well, I hope I made some sense, since I should have been sleeping two hours ago. :)

    ReplyDelete
  2. Thanks Thorbjørn. I could have asked in IRC but I wanted to document it here in case others running eathena servers run into the same trouble.

    ReplyDelete