Re: errors in git pull

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Ian Brown <ianbrn@...>
Cc: <git@...>
Date: Friday, January 18, 2008 - 9:07 am

Hi,

On Fri, 18 Jan 2008, Ian Brown wrote:


To simplify, you can

	git remote add origin git://<...>

so you can call "git pull" and it will do the same.


These are merge conflicts.  Git thinks you have changed something.

Now, this might be true, but it also might be the case that the tree you 
are pulling was rebased, i.e. rewound to a certain point in commit 
history, and committed to _differently_.

As a consequence, your state _before_ pulling looks as if _you_ changed 
something.  Since these changes are different than the now-current 
changes, but touch the same code, they produce conflicts.

You might be lucky with "git pull --rebase" (needs a pretty recent git), 
but if you are just tracking a certain tree and not committing yourself, I 
suggest something like this:

git fetch origin && git reset --hard origin/master

Of course, you _really_ have to make sure that you have no local changes 
of your own with this reset call, since it will just undo them (without 
saving them first).

If you _do_ have local changes, you might want to do a "git stash" before 
the reset, and a "git stash apply" after it (again, needs a pretty recent 
git).

Hth,
Dscho

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
errors in git pull, Ian Brown, (Fri Jan 18, 4:49 am)
Re: errors in git pull, Johannes Schindelin, (Fri Jan 18, 9:07 am)