git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Difference between pull --rebase and fetch+rebase

From
martinvz <martin.von.zweigbergk@gmail.com>
Date
Jan 7, 2010, 18:44 UTC
Message-ID
<1262889864880-4268064.post@n2.nabble.com>
In-Reply-To
<adf1fd3d1001070800k6fa501fej39b84f849b7e5b50@mail.gmail.com>

Thanks for your post, Santi. I can not share my repository since it is a project at work. I was troubleshooting a bit myself and found the following section in git-pull.sh:

	oldremoteref="$(git rev-parse -q --verify "$remoteref")" &&
	for reflog in $(git rev-list -g $remoteref 2>/dev/null)
	do
		if test "$reflog" = "$(git merge-base $reflog $curr_branch)"
		then
			oldremoteref="$reflog"
			break
		fi
	done
Why is it that reflog entries are allowed to override the remote reference?

Thanks, Martin

Santi Béjar-2 wrote:
Show 30 quoted lines
> 
> On Thu, Jan 7, 2010 at 1:23 PM, martinvz
> <martin.von.zweigbergk@gmail.com> wrote:
>>
>> I have a branch configured to track a remote branch by rebasing. I
>> excepted
>> that "git pull" would therefore be equivalent to fetching from the remote
>> repository followed by rebasing the remote branch, but it isn't. When
>> doing
>> "git rebase <remote>/<branch>", it applies only the commits after the
>> merge
>> base. When doing "git pull", it tries to apply two more commits (the two
>> commits preceding the merge base). Why is this?
>>
>> I get the same result even if I do "git pull --rebase <remote> <branch>",
>> it
>> doesn't seem to have anything to do with incorrect configuration of the
>> branch.
> 
> Yes, both should do the same (at least when upstream is not rebased).
> Can you provide a test case or instructions to reproduce the behavior?
> 
> Thanks,
> Santi
> --
> 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
> 
> 
-- 
View this message in context: http://n2.nabble.com/Difference-between-pull-rebase-and-fetch-rebase-tp4266164p4268064.html
Sent from the git mailing list archive at Nabble.com.
Previous: Santi BéjarNext: Santi Béjar
Message 4 of 8 in “Difference between pull --rebase and fetch+rebase”
  1. martinvzJan 7, 2010
  2. martinvzJan 7, 2010
  3. Santi BéjarJan 7, 2010
  4. martinvzJan 7, 2010
  5. Santi BéjarJan 7, 2010
  6. martinvzJan 7, 2010
  7. Santi BéjarJan 8, 2010
  8. martinvzJan 8, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.