Page 1 of 1

Git pull help

Posted: 22 Dec 2010, 09:56
by chaslinux
Hi all. This morning when I entered into my eathena-data directory and did a git pull I got this message:
remote: Counting objects: 21, done.
remote: Compressing objects: 100% (11/11), done.
remote: Total 11 (delta 9), reused 1 (delta 0)
Unpacking objects: 100% (11/11), done.
From git://gitorious.org/tmw-eathena-data/mainline
48ecf1f..e095298 master -> origin/master
Updating 9b3da22..e095298
conf/atcommand_athena.conf: needs update
conf/lan_support.conf: needs update
npc/001-1_Tulimshar/_import.txt: needs update
npc/002-3_Desert_mines/_import.txt: needs update
npc/007-1_Woodland/_import.txt: needs update
npc/008-1_Hurnscald_outskirts/_import.txt: needs update
npc/028-1/_import.txt: needs update
error: Entry 'npc/007-1_Woodland/_import.txt' not uptodate. Cannot merge.
How can I solve the "cannot merge" problem?

Re: Git pull help

Posted: 22 Dec 2010, 11:53
by Crush
Do you have local changes to this file? Git can not pull a new revision of a file when you have uncommitted changes to it.

You can try to merge your local changes with the new changes by using the "stash" command to save them and reset your files to the last commt. Then you can pull the new commits and use "stash apply" to apply your saved changes back. The complete workflow is:

Code: Select all

git stash
git pull
git stash apply
When you don't want your local changes anymore and you want to overwrite them, you can use

Code: Select all

git reset HEAD --hard
git pull
When everything else fails, just delete (move) the file and then do a pull.


Please be aware that I am not a git guru. I am also struggling with Git from time to time. So please take everything I write with a grain of salt.

Re: Git pull help

Posted: 22 Dec 2010, 15:14
by Jaxad0127
Using pop instead of apply would be better in most cases. The only difference is that apply keeps it in the stash stack while pop doesn't.

Code: Select all

git stash pop

Re: Git pull help

Posted: 23 Dec 2010, 21:28
by chaslinux
Crush wrote:The complete workflow is:

Code: Select all

git stash
git pull
git stash apply
Thank you Crush, I still ran into a bit of a problem because I created a file (voltain.txt) that used to exist. When I moved it out of the directory and ran the stash and pull everything worked 100% and my changes got re-applied to my server.