Re: errors in git pull

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Fri, 18 Jan 2008, Ian Brown wrote:

>  I am working agains a linux kernel net git repository.
> 
> It occurred to me more than once that when trying to
> git-pull a repository I get the following errors; there errors appear
> also after I am running
> "git-reset --hard".
> Any idea what can it be ?
> I must add that I did not made changes in my local copy of the repository.
> 
> the command I am running is:
> 
> git-pull git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.25.git

To simplify, you can

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

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

> CONFLICT (content): Merge conflict in Documentation/feature-removal-schedule.txt

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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux