Git pull help

Ask for help regarding any technical issue or report any bug or OS independent issues.
Post Reply
User avatar
chaslinux
Novice
Novice
Posts: 109
Joined: 08 Aug 2009, 01:57
Location: Kitchener, Ontario

Git pull help

Post 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?
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 16:08
Location: Germany

Re: Git pull help

Post 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.
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
User avatar
Jaxad0127
Manasource
Manasource
Posts: 4209
Joined: 01 Nov 2007, 17:35
Location: Internet

Re: Git pull help

Post 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
Image
User avatar
chaslinux
Novice
Novice
Posts: 109
Joined: 08 Aug 2009, 01:57
Location: Kitchener, Ontario

Re: Git pull help

Post 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.
Post Reply